Windows Phone 8.1 Emulator not proxying through Fiddler

Troy Hunt picture Troy Hunt · May 5, 2014 · Viewed 12.7k times · Source

I've just started looking into Win Phone 8.1 and playing with proxying some data via Fiddler from the emulator but it doesn't seem to want to play ball. All the guidance around Phone 7 and 8 (not 8.1) seems to be that the emulator will route traffic as you'd expect other apps on the machine talking HTTP to do but I'm not seeing it happen. For example, Eric's post here: http://blogs.msdn.com/b/fiddler/archive/2010/10/15/fiddler-and-the-windows-phone-emulator.aspx

There are no filters applied.

Content is loading successfully in IE on the emulator.

Fiddler is successfully capturing all traffic from the host.

The emulator can successfully browse to the host in order to pull the Fiddler root cert.

Fiddler has the registrationhostname property correctly set.

So I'm pretty much out of ideas and I'm seeing the same behaviour on multiple machines. I'm more inclined to think I've missed something obvious than I am to think something has changed in 8.1, any thoughts on what to try next?

One thing that I'm confused about is that the guidance I see (such as Eric's) talks about configuring Fiddler to allow remote connections but then there's nothing on setting a proxy in the emulator as you'd normally do with a physical device. I assume this is accounted for by configuring the host name in Fiddler and that it's then resolved by the emulator to route through the proxy?

Edit: Just for reference, I need the emulator as it'll be used in an upcoming Pluralsight course where I want to show both the phone behaviour and the traffic via Fiddler. I suspect the issue may be related to the fact that it's talking over a virtual NIC on the host, sound reasonable?

Answer

EricLaw picture EricLaw · May 5, 2014

I can successfully use Windows Phone 8.1 Virtual Machines (on Windows 8.1 Update 1) with Fiddler.

Try this:

  1. Run Fiddler.
  2. Click Tools > Fiddler Options > Connections. Change the Fiddler Listen Port from 8888 to something else, e.g. 8889. (The Windows Phone team decided to steal port 8888 for their debugger).
  3. Tick the Allow remote computers to connect box.
  4. Click Ok button
  5. In the QuickExec box below Fiddler's session list, type prefs set fiddler.network.proxy.RegistrationHostName 169.254.80.80 where the IP address is found at the top of the tooltip you see when hovering over the Online indicator at the top-right of Fiddler's toolbar.
  6. Restart Fiddler.
  7. Start VS 2013 and load your project. Click Run for the Windows Phone 8.1 emulator.
  8. Open IE. When the Settings dialog box appears, choose Custom Settings. In the Data Sense savings drop down, choose Off.
  9. Click Done.

Step #2 technically shouldn't be required (because their debugger is listening on loopback instead of the public IP), but it can't hurt. I'm not positive that Step #8 is required, but given that Data Sense's browser-optimization service is based on a proxy in the cloud, it certainly seems like it could interfere.

enter image description here