Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

让 Charles 监听 localhost 的流量 #93

Closed
Dream4ever opened this issue Sep 25, 2020 · 0 comments
Closed

让 Charles 监听 localhost 的流量 #93

Dream4ever opened this issue Sep 25, 2020 · 0 comments

Comments

@Dream4ever
Copy link
Owner

Dream4ever commented Sep 25, 2020

具体流程

在部分操作系统中,将“不对 localhost 流量使用代理”这件事硬编码(hard code)到系统中了,所以 Charles 在默认情况下是无法监听 localhost 流量的。

解决方法是使用 http://localhost.charlesproxy.com/ 这个地址。这个地址指向的是 127.0.0.1 这个 IP,并且在其它方面和 localhost 完全相同,所以可以使用这个地址,并用 Charles 来监听它。

如果使用的不是默认的 80 端口,那么在上面的地址后面加上端口号即可:localhost.charlesproxy.com:8080。

在上面的域名前任意添加内容,比如 myapp.localhost.charlesproxy.com,同样会被解析到 127.0.0.1 这个 IP。

如果将 Charles 设置为系统代理,并且 Charles 正在运行中,那么也可以用 local.charles 代替 localhost。

参考资料

@Dream4ever Dream4ever changed the title 让 Charles 监听 localhost 让 Charles 监听 localhost 的流量 Sep 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant