Performance test_Fiddler packet capture tool

Fiddler tutorial

First, configure the HTTP protocol-set the proxy premise
(the default proxy of the IE browser in the web proxy server is: 127.0.0.1:8888)
Step 1:
Open Tools>Options>Connections in turn, check Allow remote computers to connect, and remember The port number of fiddler listen on port, the default is 8888, as shown in the figure below.
Insert picture description here
Common problem: After
setting the proxy, fiddler keeps popping up: "The system proxy was changed, click to reenable fiddler capture"
Solution:
In the default browser, change the proxy setting For manual setting, for example: My default browser is Firefox: set the following proxy, restart fiddler, and the prompt disappears. As shown in the
Insert picture description here
mobile phone settings proxy
, find the settings on the phone-WiFi-open manual proxy-enter the proxy server host name and port number (the port number when fiddler configures http) to
obtain the proxy server host name:
1. Start menu bar on the computer Enter cmd-enter in the window to enter the command prompt window, enter ipconfig-enter in the window, and the IPv4 address obtained is the proxy server host name, as shown in Figure
Insert picture description here
2. In the fiddler window interface, place the mouse on the upper right corner of the online place , The host name of the proxy server will also be displayed here, as shown in the
Insert picture description here
FAQ.
After the proxy is set on the phone, the network cannot be used?

Solution
1. Open the registry (start the search bar and enter regedit), create a DWORD under HKEY_CURRENT_USER\Software\Microsoft\Fiddler2 and set the value to 80 (decimal), as shown in Figure
Insert picture description here
2. Write a fiddlerScript rule, click Rules->Customize Rules , Use Ctrl+F to find the OnBeforeRequest method, add a line of code, as shown in the figure below
if (oSession.host.toLowerCase() == "webserver:8888")
{ oSession.host = "webserver:80";

}
Insert picture description here
Restart Fiddler after setting.

Start analyzing the captured information
as shown in the figure below. Fiddler distinguishes the request information area and the response information area. Generally, it mainly analyzes the header, raw, json, and xml four pieces of information in the request information area and the response information area, and can be judged according to the error information Front-end and back-end issues
Insert picture description here
http status code: 200: The server successfully processed the request
404: Resource not found; 500: Internal server error; 503: The server is currently unable to serve the request; 302: The requested URL has been temporarily transferred; 304: The client's cached resources It is the latest and requires the client to use the cache.

How to judge the front-end and back-end problems based on the error message.
If the interface response data is incorrect, it is likely to be a back-end problem. If the request parameters are incorrect or the interface response data is correct but the page is displayed incorrectly, it is a front-end problem, such as correct input The user name and password of the mobile phone prompt: please enter the correct user name and password, capture the packet to see the requested parameters and response parameters, it is found that the front-end parameter name is wrong or the parameter value is empty, which causes an error in the background.

Fiddler filtering function When
fiddler captures packets, all requests on the phone are captured, and then filtering is required. There is a Filters on the right side of fiddler. After opening the page, check use Filters, and then set the filter rules as needed. For example, I select show only Internet host, and then enter the URL to be displayed in the input box, and then click actions>run filterset now. Filtering can be achieved. As shown in the figure,
Insert picture description here
fiddler sets the breakpoint method
. The first method : open Fiddler and click Rules-> Automatic Breakpoints ->Before Requests (this method will interrupt all sessions). To eliminate the command, click Rules-> Automatic Breakpoints ->Disabled
The second type: enter the command in the command line: bpu www.baidu.com (this method will only interrupt www.baidu.com)

The fiddler weak network simulation function
is only for Android:
1. Open Fiddler, Rules->Performance->check Simulate Modem Speeds. After checking, you will find that the network is much slower when you visit the website.
2. Open Rules—>Cutomize Rules to open the CustomRules.js file, search for m_SimulateModem, find the following two pieces of code, first check whether m_SimulateModem is true, if it is, check the next piece of code, if not, modify it to true first. The default request time is 300ms. If you want a weaker network, you can modify the following code time: request is the request time, and response is the response time. Generally, the request time is changed to a longer time, and then restart fiddler.
Insert picture description here
Insert picture description here
Protocols supported by fiddler: http, HTTPS, ftp

To capture the https URL package, you need to set https and install the certificate. The steps are as follows:

1. Open the fiddler-tools-Options-https setting

Insert picture description here
Insert picture description here
2. Take the proxy ip and port number to search for the certificate in the browser, as shown in the figure below.
Search input method: 172.22.211.69: port number (note that you must bring the port number, the port number in fiddler-tools-Options-connections), and search
Click FiddlerRoot certificate, it prompts that it has been downloaded successfully, go to the settings and install it.
Insert picture description here
Open the phone settings and see the downloaded description file at the top. Click to enter and proceed with the installation operation. After the installation is successful, you can grab the https package.
Insert picture description here

Insert picture description here
Successful installation
Insert picture description here
problems you may encounter:
① computer actively refused it can not connect, the computer usually a firewall, disable access to, or the port is not open, open the computer or run a firewall program open about interfaces like
but my The problem is mainly because I forgot to bring the port number set by fiddler when I input the ip in the browser, otherwise it will use the local ip port by default, and the local port is generally not open.
I entered
it like this: 192.168.XX.XX should actually be like this: 192.168.XX.XX: port number

Insert picture description here
 

Guess you like

Origin blog.csdn.net/weixin_46285621/article/details/112980990