Skip to content

How to configure Fiddler to gateway to a SOCKS proxy

In a previous post (in French), I presented how to use Fiddler as a man-in-the-middle between your browser and a website in order to remove some anti-anti-pub JavaScript code.

I also mentioned that I had an issue with it: I usually connect to internet via a SOCKS proxy, but for some reason, despite carefully setting up a gateway in Fiddler’s options (as below, in Tools > Telerik Fiddler Options > Gateway), that proxy was ignored. The error message said “WARNING: SOCKS Gateway was specified but is ignored“.
Fiddler broken gateway settings
And indeed, all the requests routed through Fiddler did appear from my IP rather than my chosen proxy. Weak, I was a sad panda 🙁

But all was not lost, as the proxy can also be configured via your Fiddler script! Sounds tedious at first, but actually it’s just a one-liner: at the beginning of your OnBeforeRequest function, add this line (of course edit the IP and port):
oSession["x-OverrideGateway"] = "socks=";
Fiddler script line to use a SOCKS proxy

“Et voilà” 🙂

Posted in programming, web development.

0 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

Some HTML is OK

or, reply to this post via trackback.

Please solve the CAPTCHA below in order to fight spamWordPress CAPTCHA