Charles debugging proxy is an extremely useful tool when developing websites. In this post I want to show you some of the neat features I use a lot:
- Inspect traffic
- Remove caching
- Mapping local resources
- Inspecting traffic from your mobile device It is not my intention in this post to give detailed instructions on how to use each feature, just a high level overview of them so you know what it can do for you.
This is the main feature of Charles, inspect your browser traffic. This by itself is extremely useful. Charles provides a plethora of information and multiple views of your traffic. All developer tools e.g. Chrome, Firefox or IE can do this to some degree. So this might not be a big selling point by itself. However Charles does let you do some very useful things like:
- Repeat a request with the click of a button
- Modify the parameters of the request
Inspect SSL Traffic
You can also use Charles to inspect SSL traffic, but the process is more complex (Instructions for Mac):
- First ask Charles to proxy SSL traffic for the site. Go to Proxy > Proxy Settings > SSL. And add the site to the list.
- Then reload the site in the browser, this will show you a security warning
- Follow these instructions to create a self-signed certificate that will be accepted by your browser.
- Restart your browser After doing this you should be able to inspect the SSL traffic in Charles just like it were normal http traffic.
Throttling limits the download speed for a given site. This is very useful if you want to simulate the experience of viewing a website with a slow internet connection. Usually as developers we have decent or fast Internet connections, but your users might not, so it is something you should always test with your projects.
Another handy feature is the ability to block caching of resources, this is helpful to ensure that your browser always receives a fresh version of resources while doing changes in development.
Mapping Local Resources
If you are doing all the development on your local machine you probably don’t need this. But if you are working with files uploaded or deployed on a staging server this can be extremely useful.
- In the traffic inspection view select the file you want to map
- Right click on it and select ‘Map Local’
- Select a file on your computer
- Next time you refresh the page the file from your computer will be used In this way you can quickly iterate and just upload the files when happy with the changes.
Inspecting Traffic from your Mobile Device
Charles can also inspect the traffic coming from an iPhone, very useful while developing a mobile app. The instructions on how to enable this are here. After enabling this you will see the traffic from your device in Charles as if it were from your local browser.