Testing with a Proxy
It is useful to test while running a proxy, in order to verify that network requests are being made and answered as expected.
Install the proxy on your local machine, then configure your device to go via the proxy.
- Determine the IP address of your local machine, and the port your proxy is using (see below)
- Ensure your device is on the same Wi-Fi network as your local machine (or at least that they can see each other)
- On your device go to Settings > Wi-Fi
- On iOS devices: click the More Details blue arrow for your selected network, at the bottom, set the HTTP Proxy to Manual and enter the local machine IP and the port your proxy is running on.
- On (3.2 or above) Android devices: long press the selected network, select modify network config and tick show advanced options (or proxy settings on a Kindle device), change the proxy settings to Manual, set the Proxy Hostname to the local machine IP and the Proxy Port to the port your proxy is using.
- On Windows 8 devices, access Charms menu, tap Settings → “Change PC Settings” → “Control Panel” → “Network and Internet” → “Network and Sharing Centre” and on the bottom left corner of the window, click “Internet Options”. A new window with tabs should appear. Select the “Connections” tab and click “LAN Settings” on the bottom. Click on the checkbox inside the “Proxy Settings” frame and insert your proxy IP/Port.
- Start any app on the device - you should see the network requests in the proxy (eg Charles).
Don't forget to turn the proxy off when you're done or you'll confuse yourself!
In order to proxy SSL, you'll need to install a certificate. Browse to this page on the device and follow the iOS 4 instructions:http://www.charlesproxy.com/documentation/faqs/ssl-connections-from-within-iphone-applications/
- Once you have set up your device to proxy, following the steps listed above, you will need to go to http://www.charlesproxy.com/getssl on a browser on your device to install the certificate.
- For Android you will need to provide this certificate with a name. It does not matter what you set this too. For later versions of Android, downloading this cert via Chrome seems to cause problems - suggest using a different browser such as Dolphin
- For iOS you need to make sure you browse to this URL in Safari so that the certificate installs correctly.
- Once this is set up you will need to make sure you add any locations you want to see the response for in your SSL proxy settings. This can be found in Proxy > SSL Proxy settings...
You will need to set up the SSL certificate each time you connect to Charles!
Get started with Charles
Follow the installation instructions at http://www.charlesproxy.com/documentation/installation/.
- The port being used can be found and changed under Proxy > Proxy Settings
- Under the SSL tab in Proxy > Proxy Settings:
- Make sure Enable SSL Proxying is ticked
- Click 'Add' under Location. Under Host enter * and Port enter 443 (this is the default port for SSL)