安装
brew install polipo
配置
基本配置
- polipo配置文件
vim ~/.polipo
socksParentProxy="127.0.0.1:1080"
socksProxyType="socks5"
proxyAddress="127.0.0.1"
proxyPort=8123
开机启动
- polipo.plist 文件, 可以与下面的对比下.
cat /usr/local/opt/polipo/homebrew.mxcl.polipo.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>homebrew.mxcl.polipo</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>ProgramArguments</key>
<array>
<string>/usr/local/opt/polipo/bin/polipo</string>
<!-- 开机启动 -->
<string>socksParentProxy=localhost:1080</string>
</array>
<!-- Set `ulimit -n 65536`. The default macOS limit is 256, that's
not enough for Polipo (displays 'too many files open' errors).
It seems like you have no reason to lower this limit
(and unlikely will want to raise it). -->
<key>SoftResourceLimits</key>
<dict>
<key>NumberOfFiles</key>
<integer>65536</integer>
</dict>
</dict>
</plist>
- 创建链接
ln -sfv /usr/local/opt/polipo/*.plist ~/Library/LaunchAgents/
- 加载
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.polipo.plist
- 检查
ps -ef| grep polipo
telnet localhost 8123
[~]$ telnet localhost 8123 *[master]
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection refused
telnet: Unable to connect to remote host
[~/workspace/me/hue]$ cd ~/Library/LaunchAgents/ *[master]
[~/Library/LaunchAgents]$ ln -sfv /usr/local/opt/polipo/*.plist ~/Library/LaunchAgents/
/Users/user/Library/LaunchAgents//homebrew.mxcl.polipo.plist -> /usr/local/opt/polipo/homebrew.mxcl.polipo.plist
[~/Library/LaunchAgents]$ launchctl load ~/Library/LaunchAgents/homebrew.mxcl.polipo.plist
[~/Library/LaunchAgents]$ ps -ef| grep polipo
501 7329 1 0 4:28下午 ?? 0:00.01 /usr/local/opt/polipo/bin/polipo socksParentProxy=localhost:1080
501 7337 3946 0 4:28下午 ttys001 0:00.00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn polipo