Refor Blog

Linux 上使用 Privoxy 将 socks5 代理转成 http 代理

发布日期:

环境

  • Debian 11
  • Socks5 代理

安装配置过程

1. 安装 privoxy

sudo apt install privoxy

2. 配置监听地址

编辑 /etc/privoxy/config,大约在第 780 行,将 listen-address 修改为:

listen-address  127.0.0.1:8118

如果需要局域网访问,可以改为 0.0.0.0:8118

3. 配置 socks5 转发

继续编辑 /etc/privoxy/config,大约在第 1400 行,插入以下内容:

forward-socks5   /               127.0.0.1:1080 .

这里将 Privoxy 的 http 代理(8118 端口)数据转发到 socks5 代理(1080 端口)。

4. 重启服务使配置生效

sudo systemctl restart privoxy

配置完成后,在需要 http 代理的地方填写 127.0.0.1:8118 即可。