0
votes

I am unable to make a successful HttpWebRequest in C# without the following error:

No connection could be made because the target machine actively refused it 127.0.0.1:8888

If I use a proxy, I can make a request just fine, but when I turn off my proxy I can't make any request.

I have been using Fiddler and do think it's related but I can't find the solution. If I turn on Fiddler, I am able to make this request...

I have reviewed the web.configs and machine.configs but still no dice. I've also reviewed my Internet Options proxy settings in IE and Chrome (just to be sure).

1

1 Answers

0
votes

Yes: when fiddler starts it opens a listening port on 8888 on the local machine (127.0.0.1). It also reconfigures any installed browsers to use it as a proxy. Other software on the machine might also pick up the altered settings in Internet options and use it for proxy settings. When fiddler exits normally, it reverts the settings

This is why when

if I use a proxy, I can make a request

And also why

when I turn off my proxy, I can't make any request

If your app is stuck with the proxy settings as if fiddler is running but fiddler is not running, then no program is listening on port 8888. Ensure your request has an appropriate proxy setting for the relevant state of fiddler (I.e. No proxy set, if fiddler is not running) or if you're actually trying to connect to 127.0.0.1:8888 as the endpoint (i.e. Send requests to a proxy as if it were a destination server) then ensure fiddler is running