Charles 没有注册 localhost charles 流量

Charles is not registering the localhost charles traffic

我正在使用 charles 来获取一些设备的流量,它工作正常。但出于某种原因,它没有注册来自浏览器的流量,特别是来自本地主机的流量,例如:

http://localhost:8080/apis/v1/homefeed?index=mobilefrontpage&hsvPubkey=espn-en-homescreen-video-qa&platform=android&profile=sportscenter_v1&locale=co&version=21&device=handset&lang=en&region=us&appName=espnapp&swid=57cb001d-71cb-4e37-a7a0-265d275e6752&enableHero=true&authorizedNetworks=buzzerbeater,espn1,espn2,espn3,espn_free,espnclassic,espndeportes,espnews,espnu,goalline,longhorn,sec&hasMVPDAuthedEver=false&freePreviewTimeAvailable=10&isAuthenticated=false&content=26199860

这个请愿书没有在 charles 中注册,我需要用它的一些内部调用来模拟这个,但是现在不可能了,因为 charles 问题。

我尝试使用:http://localhost.charlesproxy.com,但出现 404 问题。

有什么想法吗?谢谢

使用http://localhost.charlesproxy.com是正确的选择。您得到 404 因为 URL 中的预期资源不存在。与Charles和HTTP代理无关。

根据Charles document

Some systems are hard coded to not use proxies for localhost traffic, so when you connect to http://localhost/ it doesn't show up in Charles.

The workaround is to connect to http://localhost.charlesproxy.com/ instead. This points to the IP address 127.0.0.1, so it should work identically to localhost, but with the advantage that it will go through Charles.

实际上,您可以使用任何指向 127.0.0.1 的域,而不仅仅是 http://localhost.charlesproxy.com。比如我有一个域名donghz.com解析为127.0.0.1,你可以访问http://donghz.com:8080/apis/v1/home ...也得到相同的响应,HTTP 被 Charles 拦截。