Is there a way to configure Fiddler to intercept HTTP calls from a Windows service?

Mike Chess picture Mike Chess · May 27, 2010 · Viewed 12.8k times · Source

We're in the process of replacing an old (5+ years) Windows service application built with VS2005 that makes an HTTP GET call. There are several things that make this difficult (such as the web server is on the customer's network and we can't connect directly to it) and, unfortunately, we'd prefer not to take down the running system to replace it with a WinForm version that can be monitored by Fiddler. The new code appears to be doing everything correctly, but, alas, it is failing to authenticate.

Is there a way to configure Fiddler (2.2.9.1) to intercept HTTP calls from a Windows service?

Answer

Mike Chess picture Mike Chess · May 27, 2010

Codeka provided a clue to get me going in the right direction. The piece that was still missing was how to get the proxy configured. The <appname>.exe.config needed to have a section like the following added:

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

Once this was done the Windows service's http traffic started flowing through Fiddler.