各种场景配置代理

git bash

// http || https
git config --global http.proxy 127.0.0.1:7890
git config --global https.proxy 127.0.0.1:7890

// sock5代理
git config --global http.proxy socks5 127.0.0.1:7890
git config --global https.proxy socks5 127.0.0.1:7890

// 取消代理
git config --global --unset http.proxy
git config --global --unset https.proxy

linux terminal


export http_proxy=http://127.0.0.1:7890
export https_proxy=https://127.0.0.1:7890

unset http_proxy
unset https_proxy

windows terminal

配置全局代理即可,不要使用ping命令去ping google.com,因为ping的ICMP协议不走HTTP、HTTPS协议,可以用curl命令

posted @ 2023-10-31 16:21    阅读(29)  评论(0编辑  收藏  举报