Skip to content

Run with Docker Compose

ihc童鞋@提不起劲 edited this page Jan 22, 2023 · 3 revisions

Aboud docker-compose

With a file named as docker-compose.yml you can run docker-compose up -d or docker-compose down in the same folder to start or stop the service.

You can install docker and docker-compose to use it.

Example Compose Files

Here is a sample server(a shadowsocks with a shadow-tls), run it on your remote vps:

version: '2.4'
services:
  shadowsocks:
    image: shadowsocks/shadowsocks-libev
    container_name: shadowsocks-raw
    restart: always
    network_mode: "host"
    environment:
      - SERVER_PORT=24000
      - SERVER_ADDR=127.0.0.1
      - METHOD=chacha20-ietf-poly1305
      - PASSWORD=EXAMPLE_PASSWORD_CHANGE_IT
  shadow-tls:
    image: ghcr.io/ihciah/shadow-tls:latest
    restart: always
    network_mode: "host"
    environment:
      - MODE=server
      - LISTEN=0.0.0.0:8443
      - SERVER=127.0.0.1:24000
      - TLS=cloud.tencent.com:443
      - PASSWORD=CHANGE_IT

And the client side(you can deploy it in your private network or vps inside the country):

version: '2.4'
services:
  shadow-tls:
    image: ghcr.io/ihciah/shadow-tls:latest
    restart: always
    network_mode: "host"
    environment:
      - MODE=client
      - LISTEN=0.0.0.0:3443
      - SERVER=your_vps_ip:8443
      - TLS=cloud.tencent.com
      - PASSWORD=CHANGE_IT

Then connect cn_vps:3443 with shadowsocks protocol on your mobile phones or PCs will work.

Note: If you use shadowrocket, you don't need to run this client. Just configure it as described here.

How to Choose TLS Server

  1. Low latency: Test on your vps to make sure the destination is with low latency. You can do the checking with ping for simple, but with curl will be more accurate.
  2. Trusted by the firewall: It must be a legal service, and widely used.
  3. Using TLS servers that support tls1.3 can reduce latency. You can test it will curl setting tls version: curl -I --tlsv1.3 --tls-max 1.3 -vvv https://example.com.

Not much servers support tls1.3. But you can alway trust services by 宇宙厂 :)

File IO Performance Issue

By default, shadow-tls use INFO log level.

For io performance, you can change it to ERROR by setting an environment variable RUST_LOG=error.

It is recommended after you make sure everything works fine. It will only print error info if you change it this way.

Clone this wiki locally