Git设置和取消代理
- HTTP/HTTPS代理
git config --global https.proxy http://127.0.0.1:1080
git config --global https.proxy https://127.0.0.1:1080
git config --global --unset http.proxy
git config --global --unset https.proxy
- SOCKS5代理
git config --global http.proxy socks5://127.0.0.1:1080
git config --global https.proxy socks5://127.0.0.1:1080
git config --global --unset http.proxy
git config --global --unset https.proxy
Bash设置和取消代理
- HTTP/HTTPS代理
export http_proxy=http://proxyAddress:port
export http_proxy=http://127.0.0.1:12333
export https_proxy=http://127.0.0.1:12333
unset http_proxy
unset https_proxy
- SOCKS代理
export http_proxy="socks5://127.0.0.1:1080"
export https_proxy="socks5://127.0.0.1:1080"
unset http_proxy
unset https_proxy
上述方法都是一次性的方法,还可以直接修改配置文件,但是这个方法不太适合需要对流量进行分流的情况。
最好的办法还是在路由端就设置代理。
文章评论