Fiddler Tutorial _fiddler

Source: Internet
Author: User
Tags clear screen sessions fiddler2

Turn from: http://kb.cnblogs.com/page/130367/#introduce

The basic introduction of Fiddler

Fiddler's official Website: www.fiddler2.com

Fiddler's official Website provides a wealth of help documentation and video tutorials, which are the best materials for learning fiddler.

Fiddler is one of the most powerful and best Web debugging tools that can record HTTP and HTTPS requests from all clients and servers, allow you to monitor, set breakpoints, and even modify input and output data, Fiddler contains a powerful subsystem for event-based scripting, 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 useful tool for both developers and testers. The working principle of Fiddler

Fiddler works in the form of a proxy Web server that uses proxy addresses: 127.0.0.1, Port: 8888. It automatically logs out when the fiddler exits, so it doesn't affect other programs. However, if the Fiddler exits normally, this will cause the Web page to be inaccessible because the Fiddler does not automatically log off. The solution is to reboot the fiddler.

Other tools of the same kind

Similar tools are: HttpWatch, Firebug, Wireshark Fiddler How to capture a Firefox session

can support the HTTP proxy of any program packet can be fiddler sniff, fiddler operating mechanism is actually on the computer on the 8888-port HTTP proxy. Fiddler2 startup when the default IE agent set to 127.0.0.1:8888, while other browsers need to manually set up, so the Firefox agent to 127.0.0.1:8888 can monitor the data.

Firefox on the following steps to set up the agent

Click: Tools-> Options, click Advanced tab on the Options dialog-> Network tab-> setting. Fiddler How to capture an HTTPS session

By default, Fiddler does not capture HTTPS sessions and requires you to set up, open Fiddler tool->fiddler options->https tab

Select the checkbox, pop up the following dialog box, and click Yes

  

Click "Yes" to set it up. The basic interface of Fiddler

Look at the basic interface of Fiddler.

Fiddler's HTTP Statistics view

By displaying all the HTTP traffic, fiddler can easily show you which files generate the page you are currently requesting. With Statistics tab, users can select multiple sessions to get the total information statistics of these sessions, such as the number of bytes requested and transmitted.

Select the first and last request to get the total time consumed by the entire page load. You can also separate requests from a bar chart that are most time-consuming, thereby optimizing access to the page

Use of the quickexec command line

In the lower-left corner of the fiddler there is a command-line tool called Quickexec that allows you to enter commands directly.

Common commands are:

Help opens the Official usage page, and all commands are listed

CLS Clear Screen (Ctrl+x can also clear screen)

Select to select a session command

?. PNG used to select a picture of the PNG suffix

BPU Intercept Request

Set breakpoints in fiddler modify request

The most powerful feature of Fiddler is the ability to set breakpoints, and after you set breakpoints, you can modify any HttpRequest information including host, Cookie, or data in the form. There are two ways to set breakpoints:

First: Open fiddler click rules-> Automatic Breakpoint->before Requests (this method interrupts all sessions)

How to eliminate the command. Click rules-> Automatic Breakpoint->disabled

Second: Enter the command at the command line: Bpu www.baidu.com (This method only interrupts www.baidu.com)

How to eliminate the command. Enter commands on the command line BPU

Look at an example, analog Blog Park login, in IE Open Blog Park login page, enter the wrong username and password, with fiddler interrupt session, modified to the correct username password. This will enable you to log on successfully:

1. Use IE to open the blog Park login Interface http://passport.cnblogs.com/login.aspx

2. Open fiddler and enter Bpu http://passport.cnblogs.com/login.aspx at the command line

3. Enter the wrong username and password, click Login

4. Fiddler can interrupt this session, select interrupted session, click Inspectors tab WebForms tab to modify the username password, and then click Run to completion as shown in the following figure.

5. The result is correctly logged in to the blog park

Set breakpoint modification in fiddler response

Of course fiddler can also modify the response:

First: Open fiddler click rules-> Automatic Breakpoint->after Response (this method interrupts all sessions)

How to eliminate the command. Click rules-> Automatic Breakpoint->disabled

Second: Enter the command at the command line: Bpuafter www.baidu.com (This method only interrupts www.baidu.com)

How to eliminate the command. In the command line, enter the command Bpuafter,

The specific usage and the last section is similar, will not say more. Create Autoresponder rule in fiddler

Fiddler's Autoresponder tab allows you to return files locally without sending HTTP request to the server.

Look at an example:

1. Open the homepage of the blog, save the logo picture of the blog to the local, and make some changes to the picture.

2. Open Fiddler to find the logo picture of the session, Http://static.cnblogs.com/images/logo_2012_lantern_festival.gif, drag this session to Autoresponer tab

3. Select Enable automatic reaponses and unmatched requests passthrough

4. Under Rule Editor, select Find a file ...  Select the locally saved picture. Finally click Save.

5. Then use the IE Blog Garden home page, you will see the first page of the picture with the local.

How to filter sessions in Fiddler

Each use fiddler, open a website, can see in fiddler dozens of sessions, see dazzling. The best way to do this is to filter out some conversations, such as filtering out the pictures.   Fiddler filter in the function, in the Right Filters tab, there are many options, a little research, you know how to use. Session comparison features in Fiddler

Select 2 Sessions, right-click and click Compare, you can use WinDiff to compare the difference between the two sessions (of course you need to install WinDiff)

Coding gadgets provided in the Fiddler

Click on the Textwizard on the Fiddler toolbar, which can encode and decode string.

Query session in Fiddler

With the shortcut key Ctrl+f Open Find Sessions dialog box, enter the keyword query you want the session. The session you are querying to is displayed in yellow.

Save session in Fiddler

There are times when we need to save conversations so we can send them to others or analyze them later. The steps for saving a session are as follows:

Select the session you want to save, and 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 installs the Syntaxview plug-in, inspectors Tab->get Syntaxview tab->download and Install now ... The following figure

After the installation is successful, Fiddler will have a fiddler Script tab, as shown below:

In which we can write a script, look at an instance to make all cnblogs sessions appear red.

Put this script under the Onbeforerequest (osession:session) method and click "Save Script" if (Osession.hostnameis ("www.cnblogs.com")) {

osession["Ui-color"] = "red";

}

So all cnblogs sessions will show red. How to use fiddler when vs debug a Web site

We use visual Stuido to develop ASP.net web site also need to use Fiddler to analyze HTTP, the default time fiddler is not able to sniff localhost site. But as long as you add a dot behind the localhost, fiddler can sniff.

For example: Originally asp.net address is http://localhost:2391/Default.aspx, add a point number, become http://localhost.:2391/Default.aspx can be


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.