Search code examples
charles-proxy

View 127.0.0.1:8080 traffic in Charles Proxy


I use Charles Proxy to monitor my web traffic (specifically, looking at the API traffic in iOS and Android apps). I have an API site running locally on 127.0.0.1:8080, but that traffic doesn't appear in Charles Proxy. I've been fiddling around with the settings, but can't seem to get it to work - any ideas?


Solution

  • You can either use your private network address when accessing the web traffic (e.g. 192.168.x.xxx, 10.x.x.x, 172.16.x.x) or map a hostname to 127.0.0.1 in the hosts file.

    EDIT: I should mention that if the API is listening only on 127.0.0.1 then the hosts file should be changed. If you can't change the host file for whatever reason another option is to have the service listen to 0.0.0.0:8080 and then request using the private network address.