Privoxy 配置
Privoxy 是一款可以将 socks5 代理转换成 http 代理的工具。直接安装软件源上维护的版本即可,Debian:
$ sudo apt install privoxy
全局模式
默认监听 8118
端口,如果要开放内网访问,则编辑配置文件 /etc/privoxy/config
将 listen-address
修改如下:
listen-address :8118
添加 socks5 转发配置
echo 'forward-socks5 / 127.0.0.1:1080 .' >>/etc/privoxy/config
条件转发
即只有访问特定地址时走代理,否则直接访问。可以使用 gfwlist2privoxy 工具生成列表。
下载脚本后
# 生成配置文件
bash gfwlist2privoxy '127.0.0.1:1080'
# 应用配置文件
mv -f gfwlist.action /etc/privoxy
echo 'actionsfile gfwlist.action' >>/etc/privoxy/config
# 重启服务
systemctl restart privoxy.service