This section mainly introduces how to use Charles to capture packets and simulate weak network environment tests. Charles is able to help us see all HTTP and SSL/HTTPS traffic between the device and the Internet, including requests, responses, and HTTP headers.

HTTP proxy

We want to make sure that our mobile devices and computers are on the same LAN.

After Charles is installed, the first step is to set up the HTTP proxy. The default port number is 8888

Then check your computer’S IP address and proxy your phone’s WIFI network options. The usual steps are WIFI advanced options -> Proxy Manual -> Enter IP and port -> Save. In this example, set the WIFI proxy of the Android device to 192.168.0.110

When the connection is successful, click Allow.

After Allow, we enter the packet capture interface. The request information is displayed on the left side of the screen. However, the following figure shows that HTTPS packet capture is garbled.

To solve the PROBLEM of HTTPS garbled characters, you need to set the HTTPS proxy.

The HTTPS proxy

To fetch HTTPS interface requests, Charles needs to install a certificate on the computer.

In the following directory on the computer, we double-click install certificate and trust.

Once the certificate is installed, Charles also needs to configure the SSL proxy.

Charles Location configuration supports wildcard characters, if you do not need to capture a specific domain name, we can directly fill in *. For Host, the SSL port is 443.

After configuring the SSL proxy, you also need to install a certificate for the mobile phone to be tested. You can view the address of the certificate in the following way.

From the picture below, we know the download address: CHLS. Pro/SSL We open the mobile browser, enter this address to download the mobile certificate. Then install and trust

When we’re done, we’ll be able to grab some of the HTTPS requests. I actually tested some HTTPS requests that still couldn’t be uncoded.

Network configuration

Weak network testing is much easier. Before we get to that, let’s take a look at the Charles toolbar shortcuts:

  • Clears all captured requests

  • The red dot status indicates that the request is being captured, and the gray status indicates that the request is not being captured.

  • Stopping the SSL Proxy

  • The gray state indicates that network speed throttling is disabled, and the green state indicates that network speed throttling is enabled.

  • Gray indicates that the breakpoint is not enabled. Red indicates that the breakpoint is enabled.

  • Edit and modify the request. Click to modify the content of the request.

  • Send the request repeatedly. Click and the selected request will be sent again.

  • Validates the response to the selected request.

  • Common functions include common functions on the Tools menu.

  • Common Settings, including common Settings in the Proxy menu.

The little turtle icon here is all we need.

We can also Throttle control with Throttle Setting. The value includes Bandwidth, Utilistation, round-trip delay, and MTU in bytes. Select the BandWidth check box here to enable rate limiting.

Well, that’s the end of this article. Knowledge is long, worry not.