hanshileiai
6/5/2018 - 3:11 PM

终端代理 shadowsocks + polipo

mac安装:终端代理 shadowsocks + polipo

安装 polipo

brew install polipo

设置每次登陆启动polipo

ln -sfv /usr/local/opt/polipo/*.plist ~/Library/LaunchAgents

添加配置文件~/.polipo,允许远程访问

cat > ~/.polipo << EOF
proxyAddress = "0.0.0.0"
EOF

更多配置参数参考:polipo config.sample

配置polipo开机自启动:

launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.polipo.plist
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.polipo.plist

这样polipo就设置完成了,polipo的http代理默认在localhost:8123。

如果上边启动失败,使用 brew services 启动 polipo

brew services restart polipo

终端测试

export http_proxy=http://localhost:8123;export https_proxy=http://localhost:8123;
curl ip.cn
#当前 IP:52.199.xxx.xxx 来自:日本 Amazon

其它主机访问输入使用ip

#查看 本机 ip
ifconfig | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v '127.0.0.1'
#或者这样获取本机ip
ipconfig getifaddr en0
#192.168.8.234
#其它主机使用
export http_proxy=http://192.168.8.234:8123;export https_proxy=http://192.168.8.234:8123;
curl ip.cn
#当前 IP:52.199.xxx.xxx 来自:日本 Amazon

其它系统参考:为终端设置Shadowsocks代理