测试连通性
curl --proxy http://localhost:10809 https://www.google.com
设置git通过代理
git config --global http.proxy http://localhost:10809
git config --global http.proxy socks5://localhost:10808
常规环境变量
export http_proxy=http://localhost:10809
export https_proxy=http://localhost:10809
export all_proxy=socks5://localhost:10808
注意 默认为一次性 退出终端会被还原
如果需要永久变量
在当前用户的主目录下面有一个
.bashrc文件
假如下面3行:
export http_proxy=http://localhost:10809
export https_proxy=http://localhost:10809
export all_proxy=socks5://localhost:10808
立即生效
source ~/.bashrc
这样每次登录都自动设置代理
测试访问并且返回ip
curl ifconfig.me