PAC Socket5

基础参数:

-----------------------
代理服务器地址:
IP:127.0.0.1
PORTS:1080

当前客户端工作
IP:127.0.0.1
PORTS:8118
-----------------------

第一步: 安装privoxy软件

shell > dnf install -y privoxy 

第二步: 配置全局代理

shell > vim /etc/privoxy/config

# 打开当前客户端工作端口代码注释
listen-address 127.0.0.1:8118

# 打开代理服务器配置端口(如果没有则添加)
forward-socks5 / 127.0.0.1:1080 .

# 修改LINUX配置,让终端走代理

shell > vim /etc/profile

# 文件末尾处都添加上以下内容
proxy="http://127.0.0.1:8118"
export https_proxy=$proxy
export http_proxy=$proxy
export ftp_proxy=$proxy

shell > source /etc/profile
shell > systemctl restart privoxy

第三步:配置高级代理,只有需要走代理的才走代理

shell > vim /etc/privoxy/config

# 打开当前客户端工作端口代码注释
listen-address 127.0.0.1:8118

# 打开代理服务器配置端口(注释掉该行代码)
# forward-socks5 / 127.0.0.1:1080 .

# 在文件末尾加入行,指定规则文件
# list.action 文件放在 /etc/privoxy 下
actionsfile list.action

shell > systemctl restart privoxy

####
# 1. 如果启动失败,关闭SELINUX试试
####

第四步:调试

# 获取当前请求端的IP地址
shell > curl "http://pv.sohu.com/cityjson?ie=utf-8"