? more technical dry please poke: Listen to the Cloud blog
Charles is a clutch modification tool, compared to the tcpdump,charles has a simple and intuitive interface, easy to get started, data request control easy, easy to modify, grab the start of data pause convenient and so on advantages! Here's how to use tcpdump to grab a bag, let's introduce Charles's use.
Charles Grab Bag
Charles is an HTTP proxy server/http monitor/reverse proxy server. It allows a developer to view all HTTP traffic connected to the Internet. These include the request, response current HTTP headers (including cookies and caching information).
1. Configure the capture environment
1) Download Charles
http://www.charlesproxy.com/
2) Install Charles
After the download is complete, the installation is ready for normal use.
(PS: If you do not register, the tool will automatically close each time you use it for 30 minutes).
2. Use Charles to grab the bag
1) HTTP Grab bag
I. Open the Charles Grab Bag tool
II. Turn on network preferences? View native IP address: 10.1.1.139
Note: Android devices need to be connected to the same network segment as the PC
Iii. setting up a native agent after connecting to the same WiFi
IV. The IP address here is: 10.1.1.139; Port number defaults to: 8888
V. View on Charles
2) HTTPS grab bag (middleman)
A) Download the Charles Certificate
If you want to view HTTPS data, you need to install Charles's certificate
: HTTP://WWW.CHARLESPROXY.COM/ASSETS/LEGACY-SSL/CHARLES.CRT
b) Install the Charles Certificate
Push the downloaded CHARLES.CRT certificate onto your Android device (also available as a common tool)
$ adb Push charles.crt/sdcard/
I. Enter settings à secure à install certificate from the phone memory card
II. Find CHARLES.CRT Click Install
III. Enter the certificate name: Charles
Note: When you click Confirm, you need to set your phone unlock password
Iv. after successful installation, you can view HTTPS data via Charles.
c) Add the HTTPS address you want to view
I. Click Proxyàssl proxying Settings ...
II. Click Add in the SSL proxying domain
III. Find the HTTPS domain name you need to see in Charles to copy to the host click OK
Iv. re-access the HTTPS domain after configuration is complete to view HTTPS data
3. Using Charles to simulate a weak network environment
The test process often needs to simulate the network environment, so how to use Charles to simulate the weak network?
I. Select Proxyàthrottle Setting ...
II. Tick enable throttle and select the network environment you want to set up.
4. Set breakpoints using Charles
Charles can set breakpoints during network access, which is an artifact for developers and testers. It can be broken until the request is sent (tampering with the request) and after it is requested (tamper response)
1) Set breakpoints using breakpoint settings
2) Select the domain name Insert Breakpoint
I. Right-click to select the domain name you want to modify, click Breakpoints
II. Re-access the domain name and select Edit request to go to the edit page
Note: Charles can modify the request: URL, Headers, Text, Raw;
and response: Headers, Set Cookie, Text, Html, Raw;
Here is an example of the request's headers parameter, which is modified
III. Here to view the original headers carrying parameters: {Nbsheadertest1,nbsapp;b,nbsapp}
Now modified by breakpoint: {Nbsheadertest1,tingyuntest}
Iv. After the modification, click Execute to see that the headers in request has been modified to NBSHeaderTest1 tingyuntest
5. Using Repeat Test
In Charles, the request can be repeated via repeat and repeat advances.
Repeat advances can customize the number of repetitions and repetition intervals
Original link: http://blog.tingyun.com/web/article/detail/516
Introduction to the Android common grab kit Charles