Discussion

Pegasystems Inc.
PL
Last activity: 15 Oct 2020 11:16 EDT
Configuring Charles as a web proxy for mobile devices
Having access to network logs from your mobile device is critical to find out what exactly is happening inside mobile application. It enables you to make debugging quick and reliable, which saves valuable time.
In this article you can find helpful information about configuring your mobile device to cooperate with a web proxy. Please note that it may be problematic to setup Charles with VPN, so it is recommended to disable it before start.
What is Charles?
Charles is a powerful tool that enables you to record and display all the data that is sent and received via network by your mobile device. What's more, you can also enable it to act as a local web proxy to track all the inbound / outbound traffic from your web browser or any other application.
Charles - Key Features
- SSL Proxying - view HTTPS requests and responses
- Bandwidth Throttling - simulate slower Internet connection
- Header & Body Viewers - tool includes several viewers that are enhancing the display for headers and body. Supports: query parameters, form parameters, cookies, authentication header, XML & JSON body, form data, multipart data and compressed data
- Repeat and Compose - allows to repeat and edit requests for testing
- Breakpoints - intercept and edit requests and responses
- Rewrite - create rules that automatically modify requests and responses
How to configure Charles on your computer?
- Download & Install Charles (free trial)
- Open Charles
- Go to "Help > Local IP Addresses", find and save your IP address (it must be accessible from mobile device)
- Go to "Proxy > Proxy Settings" and make sure that HTTP Proxy port is set to 8888. Note: If you don't want to record your requests from local computer, then go to "macOS" tab and disable "Enable macOS proxy".
- If you want to record SSL traffic, then proceed to "Proxy > SSL Proxying Settings"
- Check "Enable SSL Proxying"
- Add new location that is suitable for you. Wildcards may be used here. To record all the traffic you should set:
- Host: *
- Port: *
- Go to "Help > Local IP Addresses", find and save your IP address (it must be accessible from mobile device)
How to configure Android device?
Firstly, you have to make sure that IP address of your computer is accessible for the device. To ensure that, both devices should be in the same Wi-Fi network.
- Go to your device's settings and Wi-Fi configuration.
- Press & hold on the network you're going to use.
- Select "Modify network".
- Scroll down and expand "Advanced options".
- Open "Proxy" settings and select "Manual" option.
- Set hostname and port that points to Charles web proxy:
- Proxy hostname: [IP Address of your computer, previously saved]
- Proxy port: 8888
- Click "Save".
After that, you should notice a pop-up on your computer. You should click "Allow" to proceed.
In order to view SSL requests from Android device you have to install Charles certificates. Below is a short and simple instruction how to do it. You can find more detailed one in Charles: "Help > SSL Proxying > Install Charles Root Certificate on a Mobile Device or Remote Browser".
- Launch the browser and open url chls.pro/ssl.
- The browser should download the certificate.
- Find the certificate on your device and install it. In case it cannot be installed by opening the file directly, go to "Settings > Security > Encryption & Credentials > Install a certificate" and proceed with installation.
- Certificate name: Charles
- Credential use: VPN and apps
All set up! Now, you are ready to track all network traffic inside your Android device.
Note: As of Android N, there is a need to add network security configuration in native application in order to trust the SSL certificates generated by Charles SSL Proxying. That configuration has been added to Hybrid Client 7.41. For older HC versions you have to use older Android device, if you want to record HTTPS requests.
How to configure iOS device?
Firstly, you have to make sure that IP address of your computer is accessible for the device. To ensure that, both devices should be in the same Wi-Fi network.
- Go to your device's settings and Wi-Fi configuration.
- Open "Info" icon next to your network.
- Select "Configure Proxy" and set to "Manual".
- Set server and port that points to Charles web proxy:
- Server: [IP Address of your computer, previously saved]
- Port: 8888
- Click "Save".
After that, you should notice a pop-up on your computer. You should click "Allow" to proceed.
In order to view SSL requests from iOS device you have to install Charles certificates. Below is a short and simple instruction how to do it. You can find more detailed one in Charles: "Help > SSL Proxying > Install Charles Root Certificate on a Mobile Device or Remote Browser".
- Launch the browser and open url chls.pro/ssl. Click "Allow" to open configuration profile.
- "Install Profile" screen should be shown. Click "Install" to proceed.
- A warning appears that contains further information about installing this certificate. Click "Install" to proceed.
- Verify that certificate is installed.
- Enable Certificate by going to "Settings > General > About > Certificate Trust Settings".
All set up! Now, you are ready to track all network traffic inside your iOS device.