临时代理
Windows临时代理
# HTTP
set http_proxy=http://127.0.0.1:8118
set https_proxy=http://127.0.0.1:8118
# SCOKS
set http_proxy=socks5://127.0.0.1:1080
set https_proxy=socks5://127.0.0.1:1080
# 取消 socks类似
set http_proxy=
set https_proxy=
Linux
# HTTP
export http_proxy=http://127.0.0.1:1080
export https_proxy=http://127.0.0.1:1080
# SOCKS
export http_proxy=socks5://127.0.0.1:1080
export https_proxy=socks5://127.0.0.1:1080
# 全部
export ALL_PROXY=socks5://127.0.0.1:1080
永久代理
将临时代理配置写入
~/.profile或~/.bashrc或~/.zshrc文件中
Git 代理
代理格式 [protocol://][user[:password]@]proxyhost[:port]
# HTTP
git config --global http.proxy http://127.0.0.1:8118
git config --global https.proxy http://127.0.0.1:8118
# 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