Fiddler Grab Package Tutorial

Source: Internet
Author: User
Tags clear screen documentation http request sessions port number fiddler2

Fiddler is one of the most powerful and best Web debugging tools that can record HTTP and HTTPS requests from all clients and servers, allowing you to monitor, set breakpoints, and even modify input and output data. Using Fiddler is a great help for both development and testing.

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 very useful tool for both developers and testers fiddler how it works

Fiddler works in the form of a proxy Web server that uses proxy addresses: 127.0.0.1, Port: 8888. When Fiddler exits, it automatically logs out, 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

When you click "Yes", you set the basic interface of Fiddler .

Look at the basic interface of Fiddler.

Inspectors tab There are a lot of messages to view request or response. Where raw tab can view the full message, Headers tab to see only the header in the message. The following figure

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.

It is common to command

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 a breakpoint

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 that is queried 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

Fiddler's most complex is the script system. Official Help Documentation: 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";
        }
Copy Code

So all the Cnblogs sessions will show up in 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

The second option is to add 127.0.0.1 Localsite to the Hosts file.

How do you access Http://localsite: Port number. So the fiddler can intercept it.

Response is garbled.

Sometimes we see HTML in response is garbled because HTML is compressed and we can decompress it in two ways.

1. Click on Response raw Above the "Response is encoded" the any may need to be decoded before. Click here to transform "

2. Select "Decode" in the toolbar. This will automatically decompress.

Original address: http://www.cnblogs.com/TankXiao/archive/2012/02/06/2337728.html

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.