I'm trying to use Charles Proxy in order to debug some performance issues on my iPhone. I got it all working using the "http proxy mode", but fail to do so with the "socks proxy mode". Since iOS exhibits different behavior under http proxy than in real life (see http://www.charlesproxy.com/documentation/configuration/proxy-settings/), I would really like to make the socks proxy work.
After configuring the socks proxy on my iPhone, I fail to connect to any site, and sniffing on the machine that runs Charles shows that I get a reset whenever I'm trying to connect. What step am I missing?
An explanation on how to make it work on either Mac or Windows would be much appreciated!
Now, open the Settings app of the iPhone device and navigate to "General" >> "About" >> "Certificate Trust Settings". Find the downloaded "Charles Proxy CA" certificate, then tap on it and switch it on to enable full trust for it.
Charles Web Debugging Proxy is a cross-platform HTTP debugging proxy server application written in Java. It enables the user to view HTTP, HTTPS, HTTP/2 and enabled TCP port traffic accessed from, to, or via the local computer.
Fire up the Apache server on your Mac or somewhere on the net (A raw gist would work). Create a simple PAC file.
function FindProxyForURL(url, host) {
return "SOCKS <Address of Charles-The-Proxy>:<SOCKS port>";
}
Then point your iPhones proxy settings under the network connection to HTTP Proxy-> Auto-> http://<addressOfWebServer>/proxy.pac
Don't forget to undo your proxy settings when you're done.
According to charles documentation: https://www.charlesproxy.com/documentation/configuration/browser-and-system-configuration/
Auto configuration
You can also supply an auto-configuration URL instead of entering manual configuration. This approach will enable your device to first try to use Charles, but then to fallback to using a direct connection if Charles isn't running. This is an experimental approach!
For the auto-configuration URL enter:
https://chls.pro/X.X.X.X.pac Where you replace X.X.X.X with the IP address of your computer running Charles. This defaults to port 8888. If you use a different port, just include that, e.g. https://chls.pro/X.X.X.X:XXXX.pac
You can also use Charles in SOCKS proxy mode from iOS using an autoconfiguration rule, in spite of this not being available as a manual setting. Enter the auto-configuration URL as follows:
https://chls.pro/X.X.X.X:XXXX.socks.pac
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With