OS X终端使用配置socks5 代理
在终端环境下科学上网,本来是想用proxychains4的,可是不知道什么问题,在我的电脑osx 10.11.1下没有代理效果。
如果已经启用shadowsocks 本地代理为 socks5://127.0.0.1:1080
在终端下使用
export ALL_PROXY=socks5://127.0.0.1:1080
清除代理
unset ALL_PROXY
为了方便呢,可以在.bash_profile中加上这个
function setproxy() {
# export {HTTP,HTTPS,FTP}_PROXY="http://127.0.0.1:3128" 也可以设置http代理
export ALL_PROXY=socks5://127.0.0.1:1080
}
function unsetproxy() {
# unset {HTTP,HTTPS,FTP}_PROXY
unset ALL_PROXY
}
文章评论