在Mac上用polipo将socks5转换到http的代理

安装

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

 



作者:海边的贝壳林
链接:https://www.jianshu.com/p/ba679bc2faf4
来源:简书
简书著作权归作者所有,任何形式的转载都请联系作者获得授权并注明出处。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值