add beforeProxy option to handle request before send to proxy