1、安装Tinyproxy
yum install tinyproxy
2、编辑配置文件:
vim /etc/tinyproxy/tinyproxy.conf
Port 8989 //修改代理端口
修改Allow 127.0.0.1为自己IP,只允许自己使用,或者在Allow前面打#注释,允许任何IP都可以连接到Proxy:
# Allow 127.0.0.1 //注释
#LogFile "/var/log/tinyproxy/tinyproxy.log" //注释
LogLevel Error //更改日志级别
#ConnectPort 443 //注释
#ConnectPort 563//注释
3、启动Tinyproxy服务,并设置开机自启:
systemctl start tinyproxy
systemctl enable tinyproxy
4、客户端设置:
export http_proxy="http://xxx.xxx.xxx.xxx:8989"
export https_proxy="https://xxx.xxx.xxx.xxx:8989"