1
votes

How to use Fiddler to debug traffic from any app (eg. C#/WPF app).

Basically my WPF Application makes webrequests to a REST server that exists on another server.

I try and set up my proxy to communicate with Fiddler as follows.

HttpWebRequest req .. ... WebProxy proxy = new WebProxy("localhost.", proxy.BypassProxyOnLocal = true; req.Proxy = proxy;

Have tried "localhost" (No "." at the end), have tried "127.0.0.1" and other permutations.

I have tried the sugestions at
Get HTTP requests and responses made using HttpWebRequest/HttpWebResponse to show in Fiddler and other similar posts and still cannot see any traffic.

Any further ideas on why I am not seeing traffic would be appreciated.

Thanks

2

2 Answers

0
votes

In one of the answers to the question you referenced, did you see this note:

Also note the important "caveat" that is mentioned in the Fiddler FAQ:

Why don't I see traffic sent to http://localhost or http://127.0.0.1? IE7 and the .NET Framework are hardcoded not to send requests for Localhost through any proxies, and as a proxy, Fiddler will not receive such traffic.

There are some alternatives mentioned there that might help you catch that traffic.

0
votes

Try to give your machine name instead of localhost. If that doesn't help, Add the following section into your config file.

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

Find more details here