Before we start

Go-Shadowsocks-2

We are goinbg to setup Go-Shadowsocks-2. It is 2nd version Shadowsocks written in Go-Lang.

shadowsocks/go-shadowsocks2
Modern Shadowsocks in Go. Contribute to shadowsocks/go-shadowsocks2 development by creating an account on GitHub.

Setup server

mkdir ~/shadowsocks-server/
cd ~/shadowsocks-server/
nano docker-compose.yml

Server without UDP support (good enough)

version: '3.5'
services:
  shadowsocks-server:
    container_name: shadowsocks-server
    image: shadowsocks-server
    build:
      context: ./
      dockerfile: dockerfile
    ports:
      - "8488:8488"
    command: ["go-shadowsocks2", "-s", "ss://AEAD_CHACHA20_POLY1305:[email protected]:8488"]
    restart: always

Server with UDP support

version: '3.5'
services:
  shadowsocks-server:
    container_name: shadowsocks-server
    image: shadowsocks-server
    build:
      context: ./
      dockerfile: dockerfile
    ports:
      - "8488:8488/tcp"
      - "8488:8488/udp"
    command: ["go-shadowsocks2", "-s", "ss://AEAD_CHACHA20_POLY1305:[email protected]:8488", "-udp"]
    restart: always

Please modify YOUR_PASSWORD_HERE before use.

Save the file by pressing CTRL + X, Y, ENTER

cd ~/shadowsocks-server/
nano dockerfile
FROM golang:alpine
RUN apk add git
RUN go get -u -v github.com/shadowsocks/go-shadowsocks2

Start the server.

cd ~/shadowsocks-server/
docker-compose up -d
docker-compose ps

You will see the server is running with its State to be Up.

Setup client

The client side is actually a SOCKS5 proxy server running on your local computer.

mkdir ~/shadowsocks-client/
cd ~/shadowsocks-client/
nano docker-compose.yml
version: '3.5'
services:
  shadowsocks-client:
    container_name: shadowsocks-client
    image: shadowsocks-client
    build:
      context: ./
      dockerfile: dockerfile
    ports:
      - "1080:1080/tcp"
    command: ["go-shadowsocks2", "-c", "ss://AEAD_CHACHA20_POLY1305:[email protected]_IP:8488", "-socks", "0.0.0.0:1080"]
    restart: always

Remember to change YOUR_PASSWORD_HERE.

cd ~/shadowsocks-client/
nano dockerfile
FROM golang:alpine
RUN apk add git
RUN go get -u -v github.com/shadowsocks/go-shadowsocks2

Start the client.

cd ~/shadowsocks-client/
docker-compose up -d
docker-compose ps

You will see the SOCKS5 proxy server is running with its State to be Up.

Using Shadowsocks

Now on your operation system, please setup using proxy server:

Host: 127.0.0.1
Port: 1080

No username or password is needed.

You may check if your connection is routed via Shadowsocks by checking your IP address.

What is my IP address? — echoip.thematrix.dev
What is my IP address?