Charles is a Web debugging agent that enables developers to view all HTTP and Ssl/https traffic between the machine and the Internet, including requests for HTTP 1.1 and 2.0, responses, header files, TLS information, Compression and performance as well as protobuf binary protocols for depth checking, Charles is ideal for testing Web or mobile application API requests and responses. Download and install
Charles is a charging software, but even if it is not paid, the first 30 days can be used for free, 30 days after each open only 30 minutes, the function is completely unlimited. Now we go to Charles website to download the installation package and start Charles after the installation is complete.
The above tip says that Charles can automatically configure the network settings to work with Charles, asking you to grant the Charles Agent permission to set up the application. Only need to grant it once, do you want to authorize it now. "Grant privileges" is generally selected to grant permissions. Mobile phone Catch HTTP request
To monitor the HTTP request on the phone is to make the phone and computer in a local area network, MAC OS to view the IP address according to this click on "System Preferences-> network-> Advanced->TCP/IP", and then view the IP address.
Then on the mobile phone to open the WiFi proxy settings, the relevant configuration, the server to fill out the computer's IP address, and then the port here to fill out the default Charles 8888, if you modify the other port to write their own modified port.
After the general configuration is complete, will see a Charles and mobile phone end of the connection prompt window, here chooses allow to be possible.
Mobile phone capture HTTPS request
Now many apps are using HTTPS requests, so we really need to learn how to listen for HTTPS requests. Because of the specificity of the HTTPS protocol, it requires the computer and the phone to install the certificate, otherwise you will see that the returned data are garbled. First, the computer to download the certificate of the operation of the following figure.
How to download the certificate on the mobile phone, open access to HTTP://WWW.CHARLESPROXY.COM/GETSSL on the phone, will automatically install the Charles SSL certificate. It should be noted that the same cell phone for the different computers of Charles to download the certificate, because the phone-side certificate is the computer end of the only pairing with Charles.
Finally, the relevant configuration, select Proxy->proxy settings, pop-up Proxy Setup tab, as shown in the following figure to add, crawl any site, 8888-port data.