在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
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。