Over the wall with Shadowsocks+SwitchyOmega

If you have any questions abount this article, or if you have found any errors in this article, e-mail me, please. My email address: zrg1390556486@gmail.com

This article is for communication only, please do not use for business! The author of this article is not responsible for any consequences. thanks for your attention. Thank you.

1. Server

1.1. Buy a Cloud Host

1.2. Solution 1: Using Original Shadowsocks

  1. Installing pip

    # yum install python3-pip
    or
    # curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py"
    # python get-pip.py
    
    // update
    # pip3 install --upgrade pip
    
  2. Installing shadowsocks

    # pip3 install shadowsocks
    # vim /etc/shadowsocks.json
    
    {
      "server": "server_ip",//server ip address
      "server_port": 8388,//server port
      "local_address":"127.0.0.1",//local address
      "local_port":1080,//local port
      "port_password":{ //multiple port
              "9001":"password9001",
              "9002":"password9002",
              "9003":"password9003",
         },
      "password": "password",//password
      "method": "aes-256-cfb",//encryption
      "timeout":600 //timeout
      }
    

    explanation:

    - "server": "123.123.123.123" :: server ip address
    - "server_port": 8388 :: server port
    - "local_address":"127.0.0.1" :: local ip address
    - "local_port":1080, :: local port
    - "port_password" :: port and password
    - "password": "password" :: password                                                                                                         
    - "method": "aes-256-cfb" :: encrypt method, more detail:[[http://ucdok.com/project/generate_password.html][password tool]]
    - "timeout":600 :: over time
    
  3. Configuring auto-start script

    #vim /etc/systemd/system/shadowsocks.service
    
    [Unit]
    Description=Shadowsocks
    
    [Service]
    TimeoutStartSec=0
    ExecStart=/usr/bin/ssserver -c /etc/shadowsocks.json
    
    [Install]
    WantedBy=multi-user.target
    
    Start shadowsocks
    #systemctl enable shadowsocks
    #systemctl start shadowsocks
    #systemctl status shadowsocks -l
    
  4. Auto install script

    $ vim install-shadowsocks.sh, content of file from 
    

    install-shadowsocks.sh

    # chmod +x install-shadowsocks.sh
    # ./install-shadowsocks.sh
    

1.3. Solution 2: Using docker

  1. Installing docker

    # CentOS Linux
    # yum install docker
    # systemctl enable docker
    # systemctl start docker
    
    # CentOS Stream
    # Official Site from Docker: https://docs.docker.com/engine/install/centos/
    # yum install -y yum-utils
    # yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
    # yum install docker-ce docker-ce-cli containerd.io
    # systemctl start docker
    # systemctl enable docker
    
  2. Deploy shadowsocks

    # docker run -dt --name ss -p 6443:6443 mritd/shadowsocks -s "-s 0.0.0.0 -p 6443 -m aes-256-cfb -k test123 --fast-open"
    

2. Client

2.1. Linux

2.1.1. Command Line Client on Linux

  1. Linux series

    • Debian/Ubuntu:

      $ sudo apt-get install python-pip
      $ sudo pip install shadowsocks
      
    • Fedora/Centos:

      $ sudo yum install python-setuptools   or   sudo dnf install python-setuptools
      $ sudo easy_install pip
      $ sudo pip install shadowsocks
      
    • OpenSUSE:

      $ sudo zypper install python-pip
      $ sudo pip install shadowsocks
      
    • Archlinux:

      $ sudo pacman -S python-pip
      $ sudo pip install shadowsocks
      

    sslocal is the client software and ssserver is the server software. On some Linux distros such as ubuntu, the shadowsocks client sslocal is installed under usr/local/bin. On Others such as Arch sslocal is installed under /usr/bin. Your can use whereis command to find the exact location.

    $ whereis sslocal
    

    sslocal: /usr/local/bin/sslocal

  2. /etc/shadowsocks.json

    {
    "server":"server-ip",
    "server_port":8000,
    "local_address": "127.0.0.1",
    "local_port":1080,
    "password":"your-password",
    "timeout":600,
    "method":"aes-256-cfb"
    }
    
    // start
    $ sudo sslocal -c /etc/shadowsocks.json
    
    // To run in the background
    $ sudo sslocal -c /etc/shadowsocks.json -d start
    
  3. /etc/rc.local

    $ sudo vim /etc/rc.local
    
    sudo sslocal -c /etc/shadowsocks.json -d start
    
    // Check if It Works
    # sudo systemctl status rc-local.service
    

2.1.2. Global Proxy

  1. Install and Configure polipo

    $ sudo apt install polipo
    $ sudo vim /etc/polipo/config
    
    logSyslog = true
    logFile = /var/log/polipo/polipo.log
    proxyAddress = "0.0.0.0"
    socksParentProxy = "127.0.0.1:1080"
    socksProxyType = socks5
    chunkHighMark = 50331648
    objectHighMark = 16384
    serverMaxSlots = 64
    serverSlots = 16
    serverSlots1 = 32
    
  2. Restart polipo

    $ sudo systemctl restart polipo
    
  3. Export http_proxy and https_proxy

    $ export http_proxy="http://127.0.0.1:8123/"
    $ export https_proxy="https://127.0.0.1:8123/"
    
  4. testing

    $ curl www.google.com
    

2.1.3. Solving Problem

  1. ShadowSocks start error: undefined symbol EVP_CIPHER_CTX_cleanup [Reason]

    openssl 1.1.0 "EVP_CIPHER_CTX_cleanup" is old.
    

    [Solving]

    $ vim /usr/local/lib/python3.5/dist-packages/shadowsocks/crypto/openssl.py
    
    VIM Command:
    :%s/cleanup/reset/
    :x
    
  2. not support "chacha20" [Solving]

    $ apt install m2crypto gcc -y
    $ wget -N --no-check-certificate https://download.libsodium.org/libsodium/releases/libsodium-1.0.8.tar.gz
    $ tar zxvf libsodium-1.0.8.tar.gz
    $ cd libsodium-1.0.8
    $ sudo ./configure
    $ sudo make && make install
    $ sudo echo "include ld.so.conf.d/*.conf" > /etc/ld.so.conf
    $ sudo echo "/lib" >> /etc/ld.so.conf
    $ sudo echo "/usr/lib64" >> /etc/ld.so.conf
    $ sudo echo "/usr/local/lib" >> /etc/ld.so.conf
    $ sudo ldconfig
    

2.2. Windows

2.2.1. Download

Get shadowsocks client by sending email to zrg1390556487@gmail.com

2.2.2. Configure

  1. unzip shadowsocks-20170123111438.png
  2. running shadowsocks-20170123111902.png
  3. configuring shadowsocks-20170123111953.png
  4. proxy shadowsocks-20170123112126.png

2.3. Android

2.3.1. Download

Get shadowsocks client by sending email to zrg1390556487@gmail.com

2.3.2. Configure

shadowsocks-20170123141118.png

2.4. IOS

  1. Open "App Store", To search "shadowrocket". Current price: ¥12
  2. Add server configure. Okay. ios-shadowrocket-01.jpeg ios-shadowrocket-02.jpeg

3. Browser Plugin: SwitchyOmega

3.1. Download

Get shadowsocks client by sending email to zrg1390556487@gmail.com

3.2. Configure

  1. set proxy switchyomega-01.png
  2. set rule switchyomega-02.png

    rule:http://autoproxy-gfwlist.googlecode.com/svn/trunk/gfwlist.txt
    or
    https://raw.githubusercontent.com/gfwlist/gfwlist/master/gfwlist.txt