Graphic fiddler How to grab the phone app packet "super detail"

Source: Internet
Author: User
Tags manual json sessions

1, PC-side installation fiddler

Download Address: Fiddler.exe,http://www.telerik.com/download/fiddler


2. Configure PC end Fiddler and mobile phone

(1) Configure Fiddler to allow monitoring of HTTPS

Open the Fiddler menu item Tools->fiddler Options and select decrypt HTTPS traffic and ignore server certificate errors two items, as shown in the following figure:


The first time you will be prompted to trust the Fiddler certificate and Security reminders, select Yes, and then you can manage the system's certificate management.

(2) Configure Fiddler to allow remote connections

As shown in the menu above, click Connections, select Allow remote computers to connect, the default listening port is 8888, if the occupancy can also be set, after the configuration needs to restart the Fiddler, the following figure:


(3) Configure mobile phone end

PC-side command line ipconfig to view fiddler's machine IP, native IP 10.0.4.37, as shown below


Turn on the phone to connect to the same LAN WiFi and modify the WiFi network details (Long press WiFi option-> Modify network)-> Display advanced options, select Manual proxy settings, host name fill fiddler machine IP, Port fill fiddler port, default 8888, The following figure:


At this point, the network access on the phone can be viewed in the Fiddler, the following figure Weibo and micro-letter network request:


You can double-click a row of network requests on the diagram above and the right side will display the specific request header and the return content (Response header and content), as shown in the following figure:




You can find that fiddler can view the data returned by a network request in a variety of formats, including header, TextView (text), ImageView (picture), Hexview (hexadecimal), WebView (Web page form), Auth ( Proxy-authenticate header), Caching (header cache), Cookies, Raw (original data format), JSON (JSON format), XML (XML format) is very convenient.

Stop the network monitoring words to remove the WiFi agent settings, otherwise fiddler quit after the phone on the network OH.

If you need to restore the mobile phone without password status, after the Android side can be set through the system-security-trusted credentials-users, click on the certificate to delete or clear credentials Delete all user certificates, and then set the password to none.

If you only need to monitor one software, you can turn off other applications for network access in conjunction with system traffic monitoring.


Using Fiddler to grab Android app packets

Android development friends often need to do the network data acquisition and submission of form data, and so on, however, for debugging programs, it is difficult to know how our data is sent in the form, whether to send success, if the failure of the sending is caused by what causes. The Fiddler tool provides us with a handy grab-and-hold operation that makes it easy to crawl the data sent by the browser, whether it's a mobile app or a Web browser.

The working principle of Fiddler

Fiddler is based on the agent to achieve the crawl network data packet work, when we open the Fiddler, Fiddler will be our browser's proxy to change the default to 127.0.0.1 port is 8888, when the fiddler default port, That is to say, every request we send and every response we receive will go through the fiddler, which will enable us to grab the packet.

Paths: Options?> Advanced Settings?> change proxy server settings?> LAN Settings?> advanced


8. Control whether the fiddler work

At the bottom left of the Fiddler is a button that controls whether the Fiddler is used as a proxy server to crawl packets sent and received by the browser. When I click on the button, if the button is displayed it means Fiddler is working and if the button is hidden, it means that Fiddler is not in the proxy server.


9. Reply Panel Description:


Analysis of Session Sessions

Here I randomly choose a conversation to do a simple analysis.


Replace the data returned by the server side

The use of "autoresponser" can replace the server-side returned files, when debugging needs to replace the server-side returned data, such as an already online project, it is impossible to really replace a file, we can operate


From the picture, you can see clearly that when I load the session again, I will display the 404 agents that were previously set up.

It is also possible if you need to set up a different file agent. For example, for this session, the original server-side returned the following figure:


Because the session returns a picture type, so I choose ImageView this tab, you can see the image returned at this time, if you need to use the local file agent to return the content, and the previous steps are the same, just select the agent when the local file can be , as shown in the following figure:


This time, I chose a local file as the proxy, and when I again request the session, I return the local file:


You can see that the content returned by this session is already my local agent.

Fiddler network speed limit

Fiddler also provides us with a very convenient network speed limit function, through the network speed limit function, can simulate user's some real environment. Fiddler provides the network speed limit plug-in, we can download in his website: http://www.telerik.com/fiddler/add-ons


Click "Download", download complete, click Install, need to restart Fiddler, after restarting Fiddler, you can see Fiddler toolbar tab, a fiddlerscript option.


For example, I need to delay a period of time before the request, you can do this:


Adding such a piece of code in the Onbeforerequest method "osession[" request-trickle-delay "=" 3000 ";" If you need to delay between service-side responses, simply "osession[" Request-trickle-delay "] =" 3000 "; To replace the request in response.

Using Fiddler to grab Android app packets

Finally to today's theme, how to use Fiddler to crawl the Android app packet, in fact, is very simple, just a little bit of configuration can be. Since fiddler is the default for fetching HTTP protocol packets, we need them to be able to grab an encrypted packet of HTTPS and grab an Android app packet, which needs to be configured as follows:

1. Configure Fiddler

Click the toolbar option "Tools?>fiddleroptions"

To configure https:


To configure a remote connection:


After these configurations are complete, be sure to reboot the fiddler.

You can see that the default port for fiddler is 8888, we can now type "http://127.0.0.1:8888" on the browser


By the end of our fiddler configuration, we need to configure the wireless network on the phone.

2. Mobile Phone Wireless network configuration

Note: If you need to fiddler the data packets on the Android app, then both must be in the same wireless network. (At the same time, turn off your computer's firewall if necessary)

Before you configure your phone's wireless network, you must first know the IP address of the Fiddler host:


Can see my fiddler host, which is my computer in the wireless network IP address is 192.168.1.109

Open the wireless network interface in your phone settings and do the following four steps:

Select the Connected network, click Modify Network


Click Advanced Options


Agent-> Manual


Enter the IP of the proxy server, which is the IP address and port of the host we fiddler, fiddler the default port is 8888,IP option is set to "DHCP"


Click to save, at this time the handset side is configured successfully, open fiddler, use to open NetEase news client.


At this point can see fiddler crawl NetEase app send and receive related packets.


OK, the left side is all of our sessions, I randomly select a session, the session is the image type, to view the content of the session, is our NetEase news headlines in the picture.

Attention:

1. Shut down the computer's firewall

2. If you need to crawl the mobile app's packet, you need the phone and the computer to connect to the same wireless network.

3. After the package will be fiddler shut down (improve access to the network) at the same time will be the agent on the phone off (if the agent is not closed, when the fiddler closed, or the two are not connected to the same wireless network, hand opportunities can not be normal access to the network)


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.