Skip to content
Search

Fiddler

lastmod 2024-07-18created 2014-02-2611 edits

The free web debugging proxy for any browser, system or platform.

Inspect HTTP requests from Android devices

When using HttpClient on Android, if traffic is still not captured properly in Fiddler even though you chose to use a Proxy server in Wiki Setting, you can use the method below.
Sometimes it is necessary to have a detailed view on the HTTP requests sent by your Android app and also inspect the responses from the server. With a few steps, it is quite easily possible to do this:

  1. Connect your Android device and your PC with the same network, e.g. by connecting the PC to the same Wifi.
  2. On the PC, install Fiddler.
  3. Make sure, Fiddler is configured to allow remote computers to connect:
  4. If you want, you can user Fiddler also to capture HTTPS traffic:
  5. In your Android app you have to set your PC as proxy server for the HTTP traffic. To do this, you have to provide the proxy information to the HttpClient by setting a HttpHost instance pointing to your PC’s IP address and the port Fiddler is listening at as proxy in the Http parameters:
HttpParams httpParameters = new BasicHttpParams();
HttpHost proxy = new HttpHost("<your PC's IP>", 8888); // Proxy server IP & PORT.
httpParameters.setParameter(ConnRoutePNames.DEFAULT_PROXY, proxy);
// ConnRoutePNames.DEFAULT_PROXY = "http.route.default-proxy";
httpClient = new DefaultHttpClient(httpParameters);

Now let Fiddler run on your PC and capture the traffic. Compile your Android app and start it on your mobile device. That’s it. Fiddler should now show you what’s going on between your Android app and the servers it is connecting.

Testing mobile web server integration using an HTTP Proxy

If you use a Proxy to detect packets from a mobile device, you can inspect those packets in FIddler.

  1. Get Fiddler
    Download Fiddler and install it on your PC (with Windows 2000 / XP / 2003 / Vista and Microsoft .NET Framework v2.0 or later)
  2. Set-up Fiddler
    Start Fiddler then open the Fiddler Options... window
    and in the General tab, ensure Allow remote computers to connect is checked.
    In the Connections tab, check Act as system proxy on startup and verify what port is set (eg. 8888).
    Once you've saved those settings you need to stop and re-start Fiddler.
  3. Ensure Fiddler is 'listening'
    Once Fiddler has re-started, verify that the Capture Traffic menuitem is ticked.
  4. Check the 'listening' IP
    You need to know your computer's wireless-network IP address to configure the iPhone. This screenshots shows the Command Prompt > ipconfig output:
  5. Set-up iPhone Settings
    With the computer IP address and Fiddler port, go to your iPhone's Wifi Settings and scroll down to the HTTP Proxy, choose Manual and input the Fiddler proxy info
  6. 'sniff' away
    If everything has been setup right, anything you do in Safari or other internet applications (like, say Microsoft Tag Reader) will be logged in the Fiddler window.
  7. It's extremely useful for testing/debugging - have fun!

See also

Favorite site

References


  1. Fiddler_web_debugging_proxy.pdf ↩

author Zer0 sitemap