2

In my project, every client request will have a custom HTTP header that specifies the upstream proxy (gateway) the client wants to use. There is documentation on how to use an upstream proxy in FiddlerCore, but this seems to be a global setting, not per session.

If this is not possible in FiddlerCore, how can I achieve this by sending a new request to the proxy server (possibly cloning the original one and tampering with it), and do something similar with the response I will get back?

The solution must work with HTTPS too.

Diego
  • 16,895
  • 5
  • 56
  • 64

1 Answers1

2

Beyond the global setting, you can set the proxy for an individual session in Fiddler or FiddlerCore using the Session's x-OverrideGateway flag.

So, for instance, inside the BeforeRequest handler, you could do something like:

oSession["X-OverrideGateway"] = oSession.oRequest.headers("Custom-Gateway");

That assumes that your request header looks something like:

Custom-Gateway: myproxy.example.com:8080

If you use the string DIRECT Fiddler will send the request directly to the server, bypassing any default gateway in use.

EricLaw
  • 54,427
  • 7
  • 140
  • 182