本地使用 Clash
做
查看 clash
代理配置
文章图片
可以看到 127.0.0.1:7890
同时支持 http
、socks5
协议的代理
在终端中直接运行:
export http_proxy="http://127.0.0.1:7890"
export https_proxy="http://127.0.0.1:7890"
或者走
socket5
协议的话export http_proxy="socks5://127.0.0.1:7890"
export https_proxy="socks5://127.0.0.1:7890"
或者干脆直接设置
all_proxy
export all_proxy=socks5://127.0.0.1:7890
下面测试下代理是否生效
先查看本机公网 ip
curl cip.cc

文章图片
配置代理后再次查看本机公网 ip
export all_proxy=socks5://127.0.0.1:7890
curl cip.cc

文章图片
可以看出,两次的公网地址不一样
【在终端使用代理】参考
https://zhuanlan.zhihu.com/p/...