Basic introduction of Fiddler
Fiddler's official Website: www.fiddler2.com
Fiddler official website provides a lot of help documentation and video tutorials, which is the best information for learning fiddler.
Fiddler is one of the most powerful Web debugging tools, it can record all the client and server HTTP and HTTPS requests, allowing you to monitor, set breakpoints, and even modify the input and output data, Fiddler contains a powerful event-based scripting subsystem, And can be extended using the. NET language
The more you know about the HTTP protocol, the more you can master the way fiddler is used. The more you use Fiddler, the more you can help you understand the HTTP protocol.
Fiddler is a very useful tool for developers and testers alike.
How the Fiddler works
Fiddler is working as a proxy Web server, which uses proxy addresses: 127.0.0.1, Port: 8888. When Fiddler exits, it automatically logs off, so that no other program is affected. However, if Fiddler exits abnormally, this is because Fiddler does not log off automatically, which can cause the webpage to be inaccessible. The workaround is to restart the next fiddler.
Other tools of the same kind
Similar tools are: HttpWatch, Firebug, Wireshark
Fiddler How to capture a Firefox session
can support HTTP proxy of any program's packets can be fiddler sniff, fiddler operation Mechanism is actually on this machine listening to 8888 port HTTP proxy. Fiddler2 start when the default IE proxy is set to 127.0.0.1:8888, and other browsers need to be set manually, so the Firefox agent to 127.0.0.1:8888 can listen to the data.
Set up the agent on Firefox with the following steps
Click: Tools, Options, click Advanced tab-> Network tab-Setting on the Options dialog box.
Fiddler How to capture an HTTPS session
By default, Fiddler does not capture HTTPS sessions and requires you to set the Fiddler tool->fiddler Options->https tab to open
Select the checkbox and the following dialog box appears, click "YES"
When you click "Yes", you are ready to set up.
Basic interface of Fiddler
Look at the basic interface of Fiddler.
HTTP statistics view for fiddler
By displaying all of the HTTP traffic, fiddler can easily show you which files generate the page you are currently requesting. With the Statistics tab, the user can select multiple sessions to get the total information statistics for these sessions, such as multiple requests and bytes transferred.
Select the first request and the last request to get the overall time consumed by the entire page load. You can also separate which requests take the most time from the bar chart to optimize access to the page
Quickexec use of the command line
The lower left corner of Fiddler has a command-line tool called Quickexec, which allows you to enter commands directly.
Common commands are:
Help opens the Official usage page and all the commands are listed
CLS Clear Screen (Ctrl+x can also clear the screen)
Select a command for a session
?. PNG to select a PNG suffix picture
BPU Intercept Request
Setting breakpoints in fiddler modify request
Fiddler the most powerful function is to set breakpoints, after setting breakpoints, you can modify HttpRequest any information including host, cookie or the data in the form. There are two ways of setting breakpoints:
The first type: Open fiddler click Rules-> Automatic Breakpoint->before requests (this method interrupts all sessions)
How to eliminate the command? Click rules-> Automatic Breakpoint->disabled
The second type: Enter the command at the command line: Bpu www.baidu.com (This method only interrupts www.baidu.com)
How to eliminate the command? Enter a command on the command line BPU
See an example, simulation Blog Park login, in IE open the Blog Park login page, enter the wrong user name and password, with fiddler interrupt session, modify the correct username password. This will enable you to log in successfully:
1. Open the login interface of the blog park with IE http://passport.cnblogs.com/login.aspx
2. Open fiddler and enter BPU on the command line http://passport.cnblogs.com/login.aspx
3. Enter the wrong user name and password and click Sign In
4. Fiddler can interrupt this session, select the interrupted session, click the WebForms tab under Inspectors tab to modify the username password, and then click Run to completion as shown.
5. The result is a proper login to the blog park
Fiddler Setting Breakpoint Modification response
Of course fiddler can also modify the response:
The first type: Open fiddler click rules-> Automatic Breakpoint->after Response (this method interrupts all sessions)
How to eliminate the command? Click rules-> Automatic Breakpoint->disabled
The second type: Enter the command at the command line: Bpuafter www.baidu.com (This method only interrupts www.baidu.com)
How to eliminate the command? Enter command bpuafter on the command line,
The exact usage is similar to that in the previous section, not much.
Creating Autoresponder rules in Fiddler
Fiddler's Autoresponder tab allows you to return files locally without sending an HTTP request to the server.
See an example:
1. Open the Blog home page, the blog Park logo image to local, and make some changes to the picture.
2. Open the Fiddler to find the logo image of the session, Http://static.cnblogs.com/images/logo_2012_lantern_festival.gif, drag the session to Autoresponer tab
3. Select Enable automatic reaponses and unmatched requests passthrough
4. Select the Find a file below the rule Editor ... Select a locally saved picture. Finally click Save.
5. Re-use IE Blog home page, you will see the homepage of the picture with the local.
How to filter sessions in Fiddler
Each time using fiddler, open a website, can see in the Fiddler dozens of sessions, see dazzling. The best way to do this is to filter out some conversations, such as a session that filters out images. Fiddler in the filter function, in the Right Filters tab, there are many options, a little research, you know how to use.
Session compare function in Fiddler
Select 2 sessions, right click Compare, you can use WinDiff to compare two sessions (of course you need to install WinDiff)
The encoding gadget provided in Fiddler
Click Textwizard on the Fiddler toolbar, this tool can encode and decode string.
Query session in Fiddler
Use the shortcut key ctrl+f to open the Find Sessions dialog box and enter the keyword to query the session you want. The query to the session is displayed in yellow.
Save session in Fiddler
Sometimes we need to save the conversation so that we can send it to someone or analyze it later. The steps to save the session are as follows:
Select the session you want to save, then click File->save->selected Sessions
Fiddler's script system
The most complex of Fiddler is the script system, the official Help document: Http://www.fiddler2.com/Fiddler/dev/ScriptSamples.asp.
First install the Syntaxview plug-in, inspectors tab->get Syntaxview tab->download and install Syntaxview now ... Such as
After the installation is successful, Fiddler will have a fiddler Script tab, such as:
In it we can write a script, and see an example to make all cnblogs sessions appear red.
Place the script under the Onbeforerequest (osession:session) method and click Save Script
if (Osession.hostnameis ("www.cnblogs.com")) {
osession["Ui-color"] = "red";
}
This will show red for all cnblogs sessions.
How to use fiddler when you debug a Web site vs.
We also need to use Fiddler to analyze HTTP when we are developing an ASP with visual Stuido, and by default fiddler is not able to sniff localhost's web site. But if you add a dot behind localhost, fiddler can sniff.
For example: the original ASP. NET address is http://localhost:2391/Default.aspx, add a dot number, become http://localhost.:2391/Default.aspx can
Fiddler Grab Bag Tutorial