Fiddler is a free and open-source packet analyzer. It is used for network troubleshooting, analysis, software and communications protocol development, and education. Fiddler captures HTTP and HTTPS traffic data between the browser and the server. This data is helpful to troubleshoot HTTP errors, java script errors, and performance issues related to browser page rendering, this article is a step by step tutorial to guide you how to use Fiddler and how to capture HTTP Traffic.

Capturing of HTTP and/or HTTPS traffic may include private or confidential information, such as usernames, passwords or bank info, Use caution when entering in sensitive data while Fiddler is configured to capture traffic. If possible, use test or dummy data instead of confidential data while using Fiddler.
I want to say: if you are a Java web developer, Fiddler is the must one of your tool kits.

1. Fiddler Overview

Fiddler sits between the http client and http server listening on a port for traffic. As the finger in below, it enables a proxy between two layers to intercept the traffic, the request being taken does not proceed to server directly, instead, it goes Fiddler proxy bridge, Fiddler records the incoming and outgoing data and then forward to server again.

2. Download Fiddler.

Fiddler is a Windows Forms application, available for Windows XP and later, go to download page http://www.fiddler2.com/fiddler2/, there have two versions fiddler2 and fiddler4 available, fiddler2 was written in .Net 2, fiddler4 was higher, please choose either the one to download.

3. Install Fiddler on your client machine.

After downloading, double click the exe file and agree to the installing license, follow the step-by-step wizard to complete the installation, during installing, it may ask you close all browsers.

4. Start Fiddler.

Lunch the shortcut of Fiddler from from Start > All Program, you will see the below main Fiddler UI, when starting Fiddler, it will automatically check the latest version against the Fiddler server and ask you upgrade if there have new version enviable.

 

5. Use Fiddler to Capture HTTP or HTTPS traffic.

5.1 Check overall Web sessions.

Use Internet Explorer or Mozilla FireFox, open a web page to make a request via the explorer, we will instantly see a list of the web requests in the web sessions panel. While you visit more web pages, the list will continue to quickly grow.

The web sessions show all HTTP and HTTPS sessions which were captured by Fiddler, the messages include certain key information:

  • # – An ID# of the request generated by Fiddler for your convenience
  • Result – The Result code from the HTTP Response
  • Protocol – The Protocol (HTTP/HTTPS/FTP) used by this session
  • Host – The hostname of the server to which the request was sent
  • URL – The path and file requested from the server
  • Body – The number of bytes in the Response body
  • Caching – Values from the Response’s Expires or Cache-Control headers
  • Process – The local Windows Process from which the traffic originated
  • Content-Type – The Content-Type header from the Response
  • Custom – A text field you can set via scripting
  • Comments – A text field you can set from scripting or the session’s context menu

It’s an overall summary list about what happened without much details. It’s very useful, having the data, we can easily to monitor the  HTTP errors, all requests sent to server and what’s being status.

5.2  Check Fiddler Inspectors.

when you double click on a HTTP session, the Inspectors tab from right hand side of the screen will be displayed, it visualize content of captured requests and responses in meaningful ways. In the top half of the right hand side is the request what was sent to server, there have multiple tabs of view where show format message and data(Headers, Text View, web forms, HexView, Auth, Cookies, Raw, JSON and XML). The first one is header, it logged cache, Client, Cookies/Login, Miscellaneous and Transport, these infos are particular helpful to troubleshoot.

The bottom half is response, this is the entire response being sent back to the client browser, it may possible be HTML page, image, JSON string, Cascading Style Sheet (CSS) and other resources, we can click textview, syntaxview, Imageview and other clickable tab to view it in different format, the below example demos we syntax view the html source page of this site.

5.3  Check statistics of the request.

Click on statistics tab, it will show the estimated performance statistics for the selected HTTP sessions. It given a straight-forward insight to received status and chart from high level. It’s good for performance turning.


For example, the below is the analytic data which retrieved the home page of this site.

Request Count: 1
Bytes Sent: 1,178 (headers:1,178; body:0)
Bytes Received: 148 (headers:148; body:0)ACTUAL PERFORMANCE
————–
ClientConnected: 21:44:54.604
ClientBeginRequest: 21:44:54.650
GotRequestHeaders: 21:44:54.650
ClientDoneRequest: 21:44:54.650
Determine Gateway: 47ms
DNS Lookup: 0ms
TCP/IP Connect: 452ms
HTTPS Handshake: 0ms
ServerConnected: 21:44:55.141
FiddlerBeginRequest: 21:44:55.141
ServerGotRequest: 21:44:55.142
ServerBeginResponse: 21:44:56.012
GotResponseHeaders: 21:44:56.012
ServerDoneResponse: 21:44:56.012
ClientBeginResponse: 21:44:56.012
ClientDoneResponse: 21:44:56.012Overall Elapsed: 0:00:01.362RESPONSE BYTES (by Content-Type)
————–
~headers~: 148
ESTIMATED WORLDWIDE PERFORMANCE
————–
The following are VERY rough estimates of download times when hitting servers based in WA, USA.US West Coast (Modem – 6KB/sec)
RTT: 0.10s
Elapsed: 0.10sJapan / Northern Europe (Modem)
RTT: 0.15s
Elapsed: 0.15sChina (Modem)
RTT: 0.45s
Elapsed: 0.45sUS West Coast (DSL – 30KB/sec)
RTT: 0.10s
Elapsed: 0.10sJapan / Northern Europe (DSL)
RTT: 0.15s
Elapsed: 0.15sChina (DSL)
RTT: 0.45s
Elapsed: 0.45s

6. This Fiddler tutorial is done, leave a question or comment to us if you have.

Conclusion:

In this tutorial we saw some of the basic features and examples of Fiddler, Fiddler is a very good debug tool. You may take a try if you have not used it.