配置终端代理&&搭建代理服务器
1 配置终端代理
主要是面向Mac和Linux。
1.1 查看公网IP出口
curl ip.gs
1.2 设置终端全局代理
export https_proxy=http://127.0.0.1:58591 http_proxy=http://127.0.0.1:58591 all_proxy=socks5://127.0.0.1:51837
1.3 取消终端全局代理
unset http_proxy && unset all_proxy && unset https_proxy
就离谱。。。字数太少不能发布。
那就再补充点啥吧。
2 搭建代理服务器
我的服务器操作系统:Ubuntu 18.04。
2.1 下载tinyproxy
sudo apt-get install tinyproxy
2.2 配置参数
vim /etc/tinyproxy/tinyproxy.conf
然后改“Port”为你想要的端口,即代理端口;将“Allow 127.0.0.1”注释掉,这样其他IP才能连接。
2.3 tinyproxy基本操作
service tinyproxy start #启动
service tinyproxy restart #重启
service tinyproxy stop #停止
service tinyproxy status #查看状态