返回首页 - Notes - 2016

配置 Shadowsocks


安装

  1. sudo apt-get install python-pip
  2. sudo pip install shadowsocks

配置

sudo vim /etc/shadowsocks.json

{
    "server": "服务器IP地址",
    "port_password": {
        "端口号1": "密码1",
        "端口号2": "密码2",
        ...
    },
    "timeout": 300,
    "method": "aes-256-cfb"
}

启动

sudo ssserver -c /etc/shadowsocks.json -d start


客户端使用

https://github.com/shadowsocks/shadowsocks-iOS/releases 下载最新版 GUI,填好配置即可使用


全局HTTP代理走Shadowsocks

  1. brew install polipo
  2. ln -s /usr/local/opt/polipo/homebrew.mxcl.polipo.plist ~/Library/LaunchAgents/
  3. vim ~/Library/LaunchAgents/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>
    
  4. launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.polipo.plist
  5. vim ~/.bashrc
    export http_proxy=http://localhost:8123
    export https_proxy=http://localhost:8123
    export ftp_proxy=http://localhost:8123
    
  6. source ~/.bashrc

date:2016-10-17