[Note] - Fiddler localhost

Jun 5, 2007

That’s just a reminder for me about Fiddler and localhost/127.0.0.1:

I don’t see IE7 or .NET traffic sent to localhost or 127.0.0.1.

IE7 and the .NET Framework are hardcoded not to send requests for Localhost through proxies. Fiddler runs as a proxy. The workaround is to use your machine name as the hostname instead of Localhost or 127.0.0.1.

So, for instance, rather than hitting http://localhost:8081/mytestpage.aspx, instead visit http://machinename:8081/mytestpage.aspx. Alternatively, you can use http://localhost.:8081/mytestpage.aspx (note the trailing dot after localhost). Alternatively, you can customize your Rules file like so:

static function OnBeforeRequest(oSession :  Fiddler.Session) 
{
   if (oSession.host.ToUpper() == "MYAPP") { oSession.host = "127.0.0.1:8081"; } 
} 

…and then navigate to http://myapp, which will act as an alias for 127.0.0.1:8081.