Overview
Charles is the equivalent of a "filter" inserted between the server and the client. When the client initiates a request to the server, it first filters to Charles and then Charles sends the final data to the server;
注意:此时charles发给服务器的数据,不一定是客户端请求的数据;charles在接到客户端的请求时可以自由的修改数据,甚至可以直接Block客户端发的请求
When the server receives the requested return data, it will go to Charles, which is filtered by Charles and then sent to the client; the same: The data received by the client is not necessarily the data returned by the server, but the data that Charles gives;
Charles uses Charles to configure
If you want to grab a bag, the first thing to do is to set Charles as the "filter" between the local and the server, and let all the network requests pass through Charles so that you can capture and record the content and return data you requested.
Set up an iphone HTTP proxy
After starting Charles, the first time Charles will ask you to set Charles as the System Agent, choose Allow. This completes the configuration.
Introduction to Charles Main interface
Charles provides two views of the package, named "Structure" and "Sequence", respectively.
–structure/structure view, the network request by the domain name of the access, such as a domain name has n resource requests, then all the requests under this domain will be here to do a detailed classification;
- sequence/sequence views, sort the network requests by the time they are accessed, in the order in which your computer sends requests.
Charles Filter Filter
More often than not, for a request that needs to be crawled, we typically need to filter the network request and monitor only the requests sent to the specified directory server. For this need, the following methods:
Programme I
Charles provides a simple filter function that allows you to quickly filter out network requests with the specified keywords in the URL by typing in keywords.
Fill in the filter bar in the middle of the main interface with keywords that need to be filtered out. For example, I look at the domain name address
Programme II
In Charles's menu bar, select "Proxy", "Recording Settings", then select the Include column, select Add an item, and then fill in the protocol, host address, port number you want to monitor. This can only intercept the target site's packets;
Charles Network Environment Simulation
Some bugs in development need to be reproduced in a slow network scenario. We can use Charles to control the speed of the phone.
In Charles's menu bar, select "Proxy", "throttle (throttle) Settings", then tick the Enable throttling option and select Add a throttle preset. So that it can be done;
Charles Grab Bag content garbled solution
Right-click on the installation of the Charles program to display the contents of the Info.plist file found JVMOptions在默认的-Xmx512m后面敲空格 添加-Dfile.encoding=UTF-8 .
For some other use methods, refer to: Http://zhubangbang.com/charlesproxy
iOS Development Series-charles