文章目录
  1. 1. 安装privoxy
  2. 2. 编辑配置文件
  3. 3. 启用

本身mac下面的客户端默认是没有共享局域网的功能。需要自己动手搭建了。

安装privoxy

1
brew install privoxy

看到这行已经安装成功

1
2
3
4
5
6
7
8
==> Caveats
To have launchd start privoxy at login:
ln -sfv /usr/local/opt/privoxy/*.plist ~/Library/LaunchAgents
Then to load privoxy now:
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.privoxy.plist
Or, if you don't want/need launchctl, you can just run:
privoxy /usr/local/etc/privoxy/config
==> Summary

编辑配置文件

1
2
echo 'listen-address 0.0.0.0:8118' >> /usr/local/etc/privoxy/config
echo 'forward-socks5 / localhost:1080 .' >> /usr/local/etc/privoxy/config
  • 8118 - 是要监听的http端口
  • 1082 - 是本地的shadowsocks监听端口,可以自行修改

启用

1
/usr/local/Cellar/privoxy/3.0.23/sbin/privoxy /usr/local/etc/privoxy/config

检查是否启动成功和端口是否已经监听

1
2
3
ps aux | grep privoxy
Kim 8898 0.0 0.0 2432772 664 s000 S+ 3:49下午 0:00.00 grep privoxy
Kim 8892 0.0 0.0 2463696 1332 ?? Ss 3:49下午 0:00.03 /usr/local/Cellar/privoxy/3.0.23/sbin/privoxy /usr/local/etc/privoxy/config

证明已经启动

1
2
netstat -an | grep 8118
tcp4 0 0 *.8118 *.* LISTEN

使用 ifconfig 来查看自己的本地IP地址,我自己本地是192.168.1.240
然后在其他支持http代理当中填写 192.168.1.240:8118 就可以了