Question

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?

Était-ce utile?

La solution 2

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.

Autres conseils

Use localhost.charlesproxy.com instead of localhost. That's setup on the charlesproxy.com DNS to point to 127.0.0.1, and always will. And because it's not literally localhost it should bypass the OS's hardwired logic for localhost.

It is also possible to use local.charles, but only if Charles is actually running and you're using it as your proxy. So I prefer the localhost.charlesproxy.com solution.

More information here: https://www.charlesproxy.com/documentation/faqs/localhost-traffic-doesnt-appear-in-charles/

Same problem happened to me. Using my computer's name instead of "localhost" solved my problem, and enable to display it on Charles. For example, my computer's name is "sukwon" and I solved it by using "http://sukwon.local:3000" instead of using "http://127.0.0.1:3000"

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top