$ export http_proxy=socks5://127.0.0.1:49719 # 配置http访问
$ export https_proxy=socks5://127.0.0.1:49719 # 配置https
$ export all_proxy=socks5://127.0.0.1:49719 # 配置http和https
1.临时代理
在终端中输入
export http_proxy="http://127.0.0.1:1087"
export https_proxy="http://127.0.0.1:1087"
或者直接
export all_proxy="http://127.0.0.1:52891"// 这是直接设置了http/https省得麻烦,当然你要是有分开设置的需求就分开设置
这是代理本身走的https/http
或者
export http_proxy="socks5://127.0.0.1:1086"
export https_proxy="socks5://127.0.0.1:1086"
或者
export all_proxy="socks5://127.0.0.1:1086" // 这是直接设置了http/https省得麻烦,当然你要是有分开设置的需求就分开设置
这是代理本身走的socks5
2.永久写入
如果使用的是zsh就在.zshrc中写入
export http_proxy="http://127.0.0.1:1087"
export https_proxy="http://127.0.0.1:1087"
或者
export http_proxy="socks5://127.0.0.1:1086"
export https_proxy="socks5://127.0.0.1:1086"
或者
export all_proxy="socks5://127.0.0.1:1086"
或者
export all_proxy="http://127.0.0.1:1087"
3.取消代理
unset http_proxy // 取消http代理
unset https_proxy // 取消https代理
或者直接全部取消
unset ALL_PROXY
遇到Git配置问题
a.git 移除全局配置代理
git config --global --unset http.proxy
git config --global --unset https.proxy
b.查看信息git配置信息
git config --global -l
c.设置代理
git config --global http.proxy 'socks5://127.0.0.1:1080'
git config --global https.proxy 'socks5://127.0.0.1:1080'
终端判断是否走了代理:
运行命令
curl cip.cc
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)