Network Sniffing with Fiddler
Kim Arnett Sep 19 '17
Now and then when you encounter a problem, you have to put on your Hacker hoodie and just go for it. That's how I discovered some of the debugging capabilities of Fiddler.
As an iOS developer - it's difficult to capture the network calls your app is making to determine why weird things are happening. After you've determined it's not your code, the next step is determining where it's coming from. Enter network sniffing.
Fiddler is a free HTTP proxy server application. Translated to English: Fiddler is an application that you can hook up your device to (through a proxy) and watch the network traffic go back and forth. There are other tools out there, like Charles for Mac, but today we're discussing Fiddler.
First, download Fiddler on your PC.
You'll need to do some configuration to connect another device to the proxy.
For HTTPS connections, click on the HTTPS tab under Fiddler Options.
Select the checkbox for Capture HTTPS CONNECTs, and the Decrypt HTTPS traffic checkbox.
Restart Fiddler. After any changes, you must restart Fiddler.
Note: You may have to enable Fiddler to go through the firewall.
On the right side of the Fiddler window, you'll see an "Online" status. If you don't - please refer to Telerik's documentation. It's great!
If you hover over your online status, you'll see the IP address at the bottom of the window. That's the IP address you'll need for the next step.
Go to your device's network settings, and enable a proxy.
For server, enter the IP Address from Fiddler.
For port, enter "8888" (or whatever is in the Fiddler Options -> Connections menu.)
Go to a web browser and enter "[IPADDRESS]:8888"
You should see a "Fiddler Echo Service" page.
Download the FiddlerRoot certificate
Install & Trust the certificate
Note: It's recommended to delete the certificate when you're finished
You should now be all set to go.
Now you can capture detailed network traffic, requests and responses, and figure out where things are going awry. Use your powers for good and not evil.
Originally posted on KaydaCode