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

用charles抓取請求的時候,charles總是抓不到localhost:3000發(fā)出的請求,也就沒辦法模擬數(shù)據(jù),
官網(wǎng)說什么要在charles模擬本地數(shù)據(jù)的時候域名用localhost_charlesproxy_com。(_&.)

然而很不幸的是,我本地localhost_charlesproxy_com::3000本啟動不起來項目,所以只能修改react項目的默認(rèn)域名,在react項目的package.json文件中將原來的"start": “react-scripts start”, 這一句改為"set PORT=3000 HOST=localhost_charlesproxy_com && react-scripts start",項目的本地啟動地址就變成了了localhost_charlesproxy_com::3000。此時再用charles模擬數(shù)據(jù)就成功了。

[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"
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容