I really love Fiddler! It has helped me a lot for a number of projects which in one way or another uses http request/response mechanism in its communication. Why would you want to monitor the http traffic of your iPhone application? One reason is when your iPhone application needs to use the same web services being used by an existing non-iPhone application. You may know the request parameters based on the documentation of the web services but you don’t know how the parameters are actually formed in the request. Please note that this post describes a scenario where a Mac, of course, is used for developing an iPhone application and a Windows machine hosts the Fiddler application. Pure Mac developers may know of a tool different from Fiddler to monitor http traffic.
Setup Fiddler to Serve as a Proxy Server
In Fiddler, click Tools | Fiddler Options menu item to launch the Fiddler Options dialog box. Select the Connections tab of the Fiddler Options dialog box and make sure that the Allow remote computers to connect checkbox is checked. Take note of the port number in the field labeled Fiddler listens on port:. This will be the port number that you will use when setting up the proxy server in your Mac.
Take note also of the IP address of this machine since you will have to enter this address in Mac Network Preferences. You can run IPConfig from the Windows console to get the IP Address or you can open network preferences for the same purpose.
Setup Mac OS to Use a Proxy Server
Open Network Preferences. You can launch it by either clicking on the Network icon in System Preferences or by clicking the Wi-Fi/AirPort icon (if you are using the AirPort) in top right-most portion of your screen and the Open Network Preferences menu item.
In the Network Preferences dialog box, click the Advanced button.
Under the Proxies tab, check Web Proxy (HTTP). Enter the IP address of the machine hosting the Fiddler proxy host in the Web Proxy Server field and the port number (8888 in this example) configured in Fiddler.
Click Ok and close Network Preferences.
In Fiddler, make sure File | Capture Traffic menu item is checked.
Open a browser window from Mac and watch as Http traffic from your Mac shows up in Fiddler. Run your iPhone application from the simulator and you can also see the Http traffic as your iPhone application makes request to a web service.