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:
- Download the official website according to Charles Proxy.
- 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
- 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
- After packet capture, no HTTP request sent by SDK in IDEA program is caught
Add the following code to the program to solve: