Charles Proxy is a packet capture tool. In my recent work, I wanted to test whether the SDK used in a project was sending HTTP requests, so I briefly tried this packet capture tool. Charles Proxy is installed on the Mac to capture packets. MAC version Catalina.

Main steps:

  1. Download the official website according to Charles Proxy.
  2. After Charles is installed, choose Proxy -> macOS Proxy on the menu bar. The HTTP/HTTPS Proxy in macOS is automatically set to local Proxy. The default port is 8888.

Problem solving

  1. Permission problem reported after installation:

Charles cannot configure your proxy Settings while it is on a read-only volume SETTINGS_BIN=”/Applications/Charles.app/Contents/Resources/Charles Proxy Settings”

sudo chown root "${SETTINGS_BIN}" 
sudo chmod u+s "${SETTINGS_BIN}"   
Copy the code
  1. After packet capture, no HTTP request sent by SDK in IDEA program is caught

Add the following code to the program to solve: