首先必然是安装brew,然后通过brew安装polipo

brew install polipo  

接下来就比较较劲了,编辑~/.polipo文件,注意自己的上级socksParentProxy的地址:

# config file for polipo @ ~/.polipo

proxyAddress = "0.0.0.0"  
proxyPort = 8119  
allowedClients = 127.0.0.1, 10.0.1.0/24  
allowedPorts = 1-65535  
tunnelAllowedPorts = 1-65535  
proxyName = "localhost"  
cacheIsShared = false  
socksParentProxy = "127.0.0.1:1080"  
socksProxyType = socks5  
# chunkHighMark = 33554432
# diskCacheRoot = ""
# localDocumentRoot = ""
disableLocalInterface = true  
disableConfiguration = true  
dnsUseGethostbyname = yes  
disableVia = true  
censoredHeaders = from,accept-language,x-pad,link  
censorReferer = maybe  
# maxConnectionAge = 5m
# maxConnectionRequests = 120
# serverMaxSlots = 8
# serverSlots = 2

然后调起来即可

brew services start polipo  

准确的说,brew是copy了一份plist到~/Library/LaunchAgents/homebrew.mxcl.polipo.plist

最后,每天的5点和下午4点清理polipo缓存

0 5,16 * * * polipo -x  
comments powered by Disqus