Monday, January 10, 2011

Forcing .NET to proxy requests

Two posts back to back after being away for a couple months....I'm pumped!

So I ran into a situation where I needed to know exactly what my .NET app was doing. In particular I had to log the soap calls it was making to understand them. There are probably many ways of doing this but the way I though of was to make the server proxy it's requests through fiddler. This seems like an easy thing to do but it took me forever googling it to figure it out.

Sure enough the answer is a mere 10 lines of xml in the web.config....enjoy!

<system.net>
    <defaultProxy>
      <proxy
        usesystemdefault="False"
        bypassonlocal="True"
        proxyaddress="http://127.0.0.1:8888"/>
    </defaultProxy>
</system.net>


Put the above anywhere in the configuration section and you'll be going through port 8888.

No comments:

Post a Comment