Monday, February 21, 2011

Localhost traffic debugging with Fiddler

While reading about the IE 9 RC, I noticed one feature that will make my life a lot easier:

  • Debugging of traffic sent to Localhost / 127.0.0.1 now “just works”—configuration changes are not required.

Normally Internet Explorer will automatically bypass a fixed proxy (like Fiddler) for traffic bound for //localhost and //127.0.0.1 because these “loopback” addresses point to the local machine and traditional proxy servers will not be able to interpret such addresses properly. However, for a debugging proxy running on the local computer, these are perfectly understandable addresses, and when you are debugging against a local server (like IIS Express or the ASP.NET Development Server Cassini) they often test against these loopback addresses. To proxy loopback traffic from IE8 and below, somewhat awkward workarounds are needed.

IE9 RC introduces the ability to proxy loopback traffic. To do so, simply include the token <-loopback>  in the proxy bypass list. When IE encounters this token in the bypass list, it will remove the loopback addresses (localhost, 127.0.0.1) from the list of hosts that bypass the proxy. Fiddler 2.3 and above automatically set this option when capturing traffic.

Internet Control Panel Proxy Exception list showing minus-loopback token

Read more about this and other features here.

No comments: