Fiddler: The Powerful Debugging Tool for any Web Developer
Fiddler is a debugging proxy that monitors all web requests between your computer and a remote server and allows to inspect and modify them.
Fiddler can be extended with scripts written in JScript.NET (it's very easy to write them), change the program menu, and in general it is a wonderful tool. You can use it with any browser. In the new version of Fiddler, some features may change, some may be introduced.
When you enter Fiddler, a query window opens on the left and work tabs on the right.
As you can see, there are many options, they barely fit in the image. And, believe me, there are even more opportunities.
Capabilities & Operations on requests in Fiddler
In the requests window on the left, you can view and select requests, view their headers, save them to disk all together or separately.
AutoResponder - allows you to substitute your file instead of the server.
For example, a friend asked to correct the demo.js script on the site but did not give access to the server.
With Fiddler, the task is solved simply - save the script on disk, in AutoResponder indicate that vasya.js should be taken from disk, not from the site - and fix what is needed, reload the page, check - everything is comfortable.
Composer - allows you to compose a request to the server manually.
For example, you want to make the same AJAX request as you just did. To do this, you can simply select it on the left and click the Replay button (left-top).
And if you want to change? It couldn't be easier - select Composer on the right and drag the query on the left into it. After that we fix what we want and Execute.
Filters - allows you to assign actions depending on the type of request. The options will become clear after switching to the tab.
FiddlerScript is at the heart of the power of Fiddler: a script that defines functionality. By editing it, you can add or remove menu items, columns in the list of requests, and, in general, change almost everything.
The JScript.NET programming language, which is used here, can interact with Windows in full, including communication with a database, Word, Excel.
Rules. Top-left in the menu is the Rules item. It initially contains some of the FiddlerScript features that come out of the box.
Do you want to see how your site will load "on GPRS"? Choose Rules → Performance → Simulate Modem speeds.
To add new rules, you can set them through the "Customize Rules" item (in JScript.NET, of course). The opening script contains menu items and their implementation.
When any event from an extensive list occurs, Fiddler calls the appropriate handler from the rules. For example, onBeforeRequest, onShutdown. The standard rules are well commented and writing new ones is easy.
FiddlerScript allows you to manipulate headers, requests, change the width of the channel, control the output of the request to Fiddler, and so on, etc.
Breakpoint on request
In the Rules → Automatic Breakpoints menu, you can enable Fiddler to automatically break when processing a request.
After that, if you make a request in a browser connected to Fiddler, then its execution will hang, and in the left window of Fiddler this request will be marked with a special icon.
If you select such a suspended request with the mouse, then in the SessionInspector tab you can control it: change the request itself and the server response (after Break on Response, when the server has already responded).
You can also set an interrupt on requests of a certain type through Filters.
Debugging HTTPS
Fiddler is a proxy and HTTPS is encrypted from the browser to the receiving server, so by default Fiddler does not have access to the content of HTTPS requests.
To get it, Fiddler must play the role of an interceptor hacker: decrypt requests, and then send further. This is possible if you install a special certificate: Tools → Fiddler Options → HTTPS (tab) → select all the checkboxes.
After finishing debugging, this certificate can be removed.
Fiddler
Fiddler can be downloaded for free from the developer's website. Documentation and video are also available there.