Tom

iOS Developer

5th May 2012

Monitoring an iPhone’s HTTP traffic (Part 1)

Guides | Tutorial By 2 years ago

Previously when I’ve needed to monitor web traffic from my iPhone I would use my laptop to redistribute my wifi as a 2nd network with another network card and use a tool like WireShark or Charles to monitor everything that’s being sent and received from my iPhone after I connected to the 2nd network. This was overcomplicating things, hidden in the iPhone’s settings is the ability to connect to a proxy server, meaning you can debug web traffic without the need for any 2nd networks or ethernet cables.

Get Charles, a free web debugger (there is a paid version as well without the waiting times).

Connect both your computer and iPhone to the same wireless network. Open System Preferences and under the network section select the wifi option on the left. Below your status you will see a message following the lines of “Wi-Fi is connected to YourWifiNetwork and has the IP address 192.168.1.71.”. The last part is your IP address on your network, it will be different for each person reading this, take note of it, we will connect to it later. This step is obviously different on a Windows computer.

Open Charles, click the Proxy menu and open the Proxy settings. The port field should already be populated with port 8888. If there’s nothing there, enter 8888. If there’s something else, note it down.

Now in your iPhone, open the Settings app and in the Wifi section locate your network on the list. Click the blue arrow on the right side of the network. Scroll to the bottom and in the HTTP proxy settings select manual. Enter the details you gathered from above. My Server is 192.168.1.71 and my Port is 8888.

The first time you make a request from your iPhone charles will prompt you, click Allow.

That’s pretty much it, you can now monitor all HTTP traffic going to and from the iPhone. Of course this will not work yet for monitoring SSL connections, which is something I will cover next week.

Recommended Posts

Monitoring an iPhone’s HTTPS traffic (Part 2)

Post by 2 years ago

Following on from last week's blog, this will cover monitoring an iPhone's HTTPS traffic. If you haven't already, look at the setup from last week as it is required in order for this next part...

Got an idea?

We help entrepreneurs, organizations and established brands from around
the country bring ideas to life. We would love to hear from you!