Getting to Know Fiddler: Part I: Capture and debug traffic from a mobile device
If you've done any amount of web development on Windows, you've probably used a program called “Fiddler” a few times. Fiddler is a small proxy server that allows you to see all of the requests made by your system. Sadly, for most people, I'd guess that that is all that Fiddler is. It's a shame because Fiddler offers up so much more power than that.
So, let's fix this. For the next several weeks, we're going to explore some of the under noticed functionality that Fiddler provides us. We're going to examine the functionality that past me would have loved to have known about.
Remote Debugging
One of the first bits of power is realizing that Fiddler isn't a proxy server for your desktop, but rather a proxy server that just happens to run on your desktop. Assuming we provide the configuration, Fiddler will be more than happy to proxy any traffic it receives, such as from another computer, mobile device, or even video game console. We can enable remote proxying by clicking “Tools”, “Fiddler Options…", and then the “Connections” tab. On this page, we need to enable the checkbox for “Allow remote computers to connect.”
With this stage of our configuration out of the way, we can restart Fiddler and move to another device on the network. The device we want to examine will need a bit of manual configuration to configure proxying. For specific device configuration instructions, you'll need to head to Google. 1
In the case of my iPhone, I opened Settings, clicked on my network, and then scrolled to the bottom of the page where I was able to enter the IP address of my desktop, and the port we configured for our proxy, in this case, 8888.
Now time for some web traffic to prove that our proxy works. In this case, I launched the Pinterest app. 2 Immediately Fiddler lit up with requests and responses. We can use this technique to allow debugging of devices where no debugging proxy is natively available. When we're done, we can simply go back in to our device and remove the proxy configuration. 3
This technique can be invaluable for diagnosing a computer where installing Fiddler isn't an option, as well as developing for any form of mobile device.
Now Fiddler is no longer limited to showing us the things we browse from our computers. Still, our current outlook doesn't consider it much more than a glorified Firebug. Next week we'll start on the functionality that truly sets it apart.
Footnotes
You should be able to search “How to setup a proxy for” your device. The only device that I regularly use that I couldn't find a page for was the original Kindle. ↩︎
Yep. Pinterest. It is actually okay for a guy to be on Pinterest. If you feel the obligation to become indignant though, focus not on the fact that I chose the Pinterest app, but that the Pinterest app traffic was HTTP. Not necessarily bad, just interesting. ↩︎
If you forget to remove the proxy configuration from your device, you'll likely see that you are unable to browse the web after closing Fiddler, or leaving the network that Fiddler is running on. You also won't be able to pull up this warning, so there's that. ↩︎