平时用Shadowsocks(ss)来翻墙,但是ss在浏览器(Chrome)自动,而在控制台(iTerm)不是,但只要修改一下 ALL_PROXY和 http_proxy这些变量就可以 了:
Egg疼的是,我在另外一台机器(MacBook)却不行(在浏览器正常翻,但开发React Native时必须用到的iTerm/Terminal不行)
我找遍了Google,照着教程安装 privoxy 之类的,还是不行
Help, 求教怎么破?
平时用Shadowsocks(ss)来翻墙,但是ss在浏览器(Chrome)自动,而在控制台(iTerm)不是,但只要修改一下 ALL_PROXY和 http_proxy这些变量就可以 了:
Egg疼的是,我在另外一台机器(MacBook)却不行(在浏览器正常翻,但开发React Native时必须用到的iTerm/Terminal不行)
我找遍了Google,照着教程安装 privoxy 之类的,还是不行
Help, 求教怎么破?
先用 curl
确认下你设置的代理是否有用,根据输出,你的 curl -v ...
命令并没有走代理
➜ ~ export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890
➜ ~ curl -v ipinfo.io
* Uses proxy env variable http_proxy == 'http://127.0.0.1:7890'
* Trying 127.0.0.1:7890...
* Connected to 127.0.0.1 (127.0.0.1) port 7890 (#0)
> GET http://ipinfo.io/ HTTP/1.1
> Host: ipinfo.io
> User-Agent: curl/7.87.0
> Accept: */*
> Proxy-Connection: Keep-Alive
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Transfer-Encoding: chunked
< Access-Control-Allow-Origin: *
< Connection: keep-alive
< Content-Type: application/json; charset=utf-8
< Date: Fri, 07 Apr 2023 09:26:29 GMT
< Keep-Alive: timeout=4
< Proxy-Connection: keep-alive
< Referrer-Policy: strict-origin-when-cross-origin
< Strict-Transport-Security: max-age=2592000; includeSubDomains
< Vary: Accept-Encoding
< Via: 1.1 google
< X-Content-Type-Options: nosniff
< X-Envoy-Upstream-Service-Time: 2
< X-Frame-Options: SAMEORIGIN
< X-Xss-Protection: 1; mode=block
<
{
"ip": "153.122.172.151",
"hostname": "ax.ptr238.ptrcloud.net",
"city": "Tokyo",
"region": "Tokyo",
"country": "JP",
"loc": "35.6895,139.6917",
"org": "AS131921 GMO GlobalSign Holdings K.K.",
"postal": "101-8656",
"timezone": "Asia/Tokyo",
"readme": "https://ipinfo.io/missingauth"
* Connection #0 to host 127.0.0.1 left intact
}
有伙伴让我用这个就完美解决了!!