I am tring to debug whats wrong with my HTTP requests from another question here on SO. So i read a bit about Fiddler and wanted to use it to debug my problem. But I can't seem to get traffic from my WPF application to go through Fiddler. I believe I need to configure a proxy. I am using a WebClient for a basic example, but I think i will require a WebRequest later. But for now, with a simple WebClient, how can I get it to go through Fiddler (I believe I have to set proxy to localhost:8888)?
UPDATE:
I don't know if i did the right thing or not but I tried
var wc = new WebClient();
WebProxy proxy = new WebProxy();
proxy.Address = new Uri("http://localhost:8888");
wc.Proxy = proxy;
but failed - I don't see any traffic in Fiddler
I tried ...
var wc = new WebClient();
WebProxy proxy = new WebProxy("127.0.0.1", 8888);
wc.Proxy = proxy;
still nothing
All the time I use below configuration to redirect the network HTTP calls to pass thru fiddler proxy from my applications.
This works in all kinds of .NET applications (which has either
web.config
orapp.config
file) and in fiddler its best to disableCapture Traffic
option to avoid capturing general traffic from all the applications running. Shortcut key for this is F12.This is valuable configuration if you have third party assemblies in which you don't have chance of changing the code that calls URL.
I hope this helps someone.
Maybe a little late, but...
I get around this simply by appending a "dot" to localhost, so instead of accessing
localhost
, I try to accesslocalhost.
(notice the dot at the end of the hostname)Credit where credit is due: I got this unusual tip from this thread http://www.west-wind.com/weblog/posts/2009/Jan/14/Monitoring-HTTP-Output-with-Fiddler-in-NET-HTTP-Clients-and-WCF-Proxies#596591
Works fine!
I found the solution at this fiddler2.com page
You can find answer in below post https://stackoverflow.com/a/7506427/471499
it lists that you need to add this in your web.config OR App.Config
That's all, but don't forget to remove the web.config lines after closing the fiddler, because if you don't it will make an error.
Reference : http://fiddler2.com/documentation/Configure-Fiddler/Tasks/UseFiddlerAsReverseProxy
"IIS Express won't receive traffic to machinename so instead route to localhost.fiddler fiddler2.com/documentation/Configure-Fiddler/Troubleshooting/… – robrich May 9 '13 at 6:02"
RobRich above got it right. This is the only thing that worked as I can only use IIS Express.