Skip to content

Instantly share code, notes, and snippets.

@karaggeorge
Last active March 4, 2021 20:29
Show Gist options
  • Save karaggeorge/18814fa8bb32972d94b3b525f1ee8565 to your computer and use it in GitHub Desktop.
Save karaggeorge/18814fa8bb32972d94b3b525f1ee8565 to your computer and use it in GitHub Desktop.
Charles

Charles Proxy

SSL Proxying

Charles Setup

On the menu bar click Proxy -> SSL Proxying

On the window that opens up, check the option Enable SSL Proxying

In the Include panel below, you should have one entry for *.*. If you don't, click Add

On the new window that opens up, add *.* to the Host: field and click OK

Edit Location Window

The final window should look like this: SSL Proxying Settings

Phone Setup

By default Charles proxy runs on port 8888. If for some reason that port is blocked or used, it'll use a different one. If any of the steps below don't work, try checking the port Charles is running on.

To complete the following steps you'll need to know your computer's local IP address.

In your phone or emulator, open the Settings app, go to Network & Internet -> Wi-Fi.

Click the gear icon to the right of your selected WiFi network.

Note: If you are using a physical device it needs to be on the same network as your computer.

On the top-right corner click the pencil icon.

WiFi Network Edit

In the window that opens, toggle Advanced options

Advanced Options

For the field Proxy, select Manual For the field Proxy hostname enter your computer's IP Address For the field Proxy port enter the port Charles is running on (Default is 8888)

Then click Save

Proxy Settings

Shortly, you should see a dialog open up in Charles. If not, try opening the browser on the device and visiting a random page.

In that dialog, press Allow

Charles Allow Connection

Now you should be able to see the requests coming in from the phone in your Charles app. But not the contents, since we haven't installed the certificate yet.

To do that, open the browser in your device, and visit the following path: chls.pro/ssl.

Click Download on the window that opens up.

Download Charles certificate

Once downloaded, click Open

Enter any name (something like Charles Certificate), make sure VPN and apps is selected and click OK

Save Charles certificate

Now try going to any other page in the browser and you should be able to inspect all traffic in Charles.

FAQ and other topics

Finding your IP address

If you are on macOS, to find your IP address, you can simply hold the Alt/Option key (key to the left of Command) and while pressing it click your wifi icon in your menubar.

In the window that opens up, your IP address will be directly under your WiFi networks name.

macOS IP Address

For Windows users, open Command Prompt, enter ipconfig and you should see your IP next to IPv4 Address under your Network Adapter's info

Disable macOS proxying

By default Charles also monitors the laptop's calls. If you want to disable that in the menu bar, go to Proxy and unselect macOS Proxy, or shortcut: Shift + Command + P

This will disable it for this current session, but every time Charles starts it'll enable that again. If you want to disable it completely and only turn it on if you ever need it, follow these steps:

In the menu bar click Proxy -> Proxy Settings In the window that opens up, click macOS on the top panel switcher In that panel, unselect Enable macOS proxy on launch

Proxy Settings

Checking which port Charles is running on

To check what port Charles proxy is running on currently, in the menu bar go to Proxy -> Proxy Settings

In the default panel Proxies the port should be displayed under HTTP Proxy

Proxy Settings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment