Charles不能抓取到本地localhost或者127.0.0.1的请求

用charles抓取请求的时候,charles总是抓不到localhost:3000发出的请求,也就没办法模拟数据,
官网说什么要在charles模拟本地数据的时候域名用localhost_charlesproxy_com。(_&.)

然而很不幸的是,我本地localhost_charlesproxy_com::3000本启动不起来项目,所以只能修改react项目的默认域名,在react项目的package.json文件中将原来的"start": “react-scripts start”, 这一句改为"set PORT=3000 HOST=localhost_charlesproxy_com && react-scripts start",项目的本地启动地址就变成了了localhost_charlesproxy_com::3000。此时再用charles模拟数据就成功了。

[charles开启Charles-Proxy-macOS Proxy 时报错]

Charles cannot configure your proxy settings while it is on a read-only volume. Perhaps you are running Charles from the disk image? If so, please copy Charles to the Applications folder and run it again. Otherwise please ensure that Charles is writable by the current user and try again.
解决:

终端输入后重启

    sudo chown -R root "/Applications/Charles.app/Contents/Resources"
    sudo chmod -R u+s "/Applications/Charles.app/Contents/Resources"
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容