How to manually install upstream proxy for the Fiddler kernel?

I would like to be able to redirect http requests from fiddler code through proxies up, which I want to specify at runtime.

I looked at the FiddlerApplication functions, and I see nothing that could fit, and I also did not find anything suitable in the documentation (except that you can specify the launch flag to use the system proxy as a proxy server up).

What is the best way to specify / change the fiddler kernel proxy at runtime?

+8
c # fiddler fiddlercore
source share
2 answers

If you want to send each request to the proxy server, and this proxy server is not the system default: before sending each request in the session, specify the X-OverrideGateway flag. Inside the BeforeRequest handler, add the following line:

 oSession["X-OverrideGateway"] = "someProxy:1234"; 

Eric

+11
source share

As EricLaw said in his answer that you should specify the X-OverrideGateway flag in the session, although if you want to do basic HTTP authentication in the proxy server up, you can set credentials by adding the Proxy-Authorization header for the session inside your handler BeforeRequest such as

 string userCredentials = string.Format("{0}:{1}", "user", "password"); string base64UserCredentials = Convert.ToBase64String(Encoding.UTF8.GetBytes(userCredentials)); oSession.RequestHeaders["Proxy-Authorization"] = "Basic " + base64UserCredentials; 

Here is a list of HTTP header fields https://en.wikipedia.org/wiki/List_of_HTTP_header_fields

+2
source share

All Articles