Answered

Fiddler with localhost

 I'm trying to configure my test environment to use Fiddler Everywhere with an ASP.NET Core MVC project in VisualStudio using IIS Express. When I launch the project it comes up as a URL on localhost.

This connection does not appear in Fiddler. In Fiddler I can use the Composer to go to that URL and it works fine. What I would prefer is that Fiddler monitored localhost.

I have reviewed the documentation and this forum and I see that others have raised this issue and that some solutions are offered, but they don't work for me. Can someone confirm that they should work.

I am using:
- VisualStudio 16.7.6
- FireFox 81.0.2 (64-bit)
- Fiddler Everywhere (free, I don't see version number)

Generally, when I edit the URL with my machinename I get: "HTTP Error 400. The request hostname is invalid."

Alternatively, I get: "[Fiddler] DNS Lookup for "ipv4" failed. System.Net.Sockets.SocketException No such host is known." (Similar with ipv6)


Best Answer

 Nick,

Thank you for the detailed response. Your last response came to me at 5:58 AM; I hope that is due to the time zone and not that you were working that late on my problem!

After some fooling around I was able to make this work. By my analysis, however, the only step that was essential was the setting of the "network.proxy.allow_hijacking_localhost" to "true" in about:config. After I did this, I reversed the proxy settings, removed the Fiddler Everywhere security certificate, and re-enabled the cache in Firefox.

So, in case someone else stumbles across this thread, here are my instructions:
FireFox version: 81.0.2 (64-bit)
Fiddler Everywhere version: 1.1.1

1. Open the FireFox browser. In the address window type "about:config" (without the quote marks.

2. You will see a "Proceed with Caution" message. Select the "Accept the Risk and Continue".

3. In the search box start typing "network.proxy ..." until the "network.proxy.allow.hijacking.localhost" line appears. (It is set to false by default.)

4. Select the toggle icon to the right and toggle it to true.

5. Close the tab (which apparently automatically saves the setting.)

Note: I don't know what risks might be associated with this change. (I'd be interested to hear others weigh in on this.) I'm assuming there is some reason that the browser doesn't monitor localhost by default, possibly a security risk. So it's probably prudent to set the value back to false when you are done coding.

Mario


1 person has this question

There is this article about configuring the classic Fiddler alongside Firefox. You could use it as a reference but remember to set the port for Fiddler Everywhere, 8866 (for the traditional Fiddler the port is 8888). Apart from that, you could download the latest version of Fiddler Everywhere (check the version from your Help > About dialog, and if you don't see one, you are using an older version).


As a side question - are you experiencing the issue when testing with the Google Chrome browser?

Additionally apart from explicitly setting the Fiddler proxy in Firefox and removing the localhost from No Proxy for option in the network tab (of Firefox) can you also try to set this property in the Firefox about:config page.

After some additional investigation I was able to capture localhost traffic from IIS Express on FIrefox (version 81).


Here are the things that I had to do to be able to work with the generated localhost address from IIS:


- Set the Firefox to respect the Fiddler Everywhere proxy 127.0.0.1:8866 (this should work with the automatic detection of system proxy as FE is setting the same in the system proxy).

- Import the Fiddler Everywhere trust certificate in Firefox (Firefox > Options > Privacy & Security > Certificates > View Certificates > Authorities > Import). The Fiddler trust certificate can be exported from Fiddler Everywhere > Settings > HTTPS > Advanced Settings > Export root certificate to Desktop.

- In Firefox, open the developer tools (F12) and go to Network and check Disable Cache (alternatively do this: https://dzone.com/articles/how-turn-firefox-browser-cache).

- Start your IIS Express server and turn on the Fiddler Everywhere capturing and finally make the request to http://localhost:8080 (or your pre-set localhost address) and you should be able to see the captured traffic.

Answer

 Nick,

Thank you for the detailed response. Your last response came to me at 5:58 AM; I hope that is due to the time zone and not that you were working that late on my problem!

After some fooling around I was able to make this work. By my analysis, however, the only step that was essential was the setting of the "network.proxy.allow_hijacking_localhost" to "true" in about:config. After I did this, I reversed the proxy settings, removed the Fiddler Everywhere security certificate, and re-enabled the cache in Firefox.

So, in case someone else stumbles across this thread, here are my instructions:
FireFox version: 81.0.2 (64-bit)
Fiddler Everywhere version: 1.1.1

1. Open the FireFox browser. In the address window type "about:config" (without the quote marks.

2. You will see a "Proceed with Caution" message. Select the "Accept the Risk and Continue".

3. In the search box start typing "network.proxy ..." until the "network.proxy.allow.hijacking.localhost" line appears. (It is set to false by default.)

4. Select the toggle icon to the right and toggle it to true.

5. Close the tab (which apparently automatically saves the setting.)

Note: I don't know what risks might be associated with this change. (I'd be interested to hear others weigh in on this.) I'm assuming there is some reason that the browser doesn't monitor localhost by default, possibly a security risk. So it's probably prudent to set the value back to false when you are done coding.

Mario