This post will be a simple instruction how to install ShadowSocks Proxy via docker and use it with vmess, also proxing it through CDN network via websockets.
how it works
(Client) <-> [ CDN Service ] <-> [ Upstream Server ] <-> (Internet)
what we will use
- v2ray docker compose
- caddy docker proxy
- CDN Service: A Content delivery network like Cloudflare, ArvanCloud or DerakCloud.
check the CDN free plans, and choose suitable for you.
This guide assumes you are using CloudFlare as your domain CDN and DNS managment. It will allow to auto provision ssl without any setup and cloudflare have more servers in its infrastructure.
Requirements
- Linux VPS or any other server with linux and dedicated IP.
- Installed git, docker and docker compose plugin.
- Domain name connected to CDN.
- Python 3
Preparations
In your CDN, create an
A
record pointing to your server IP with the proxy option turned off.Clone v2ray-docker-compose repo to your server.
git clone https://github.com/lucaslorentz/caddy-docker-proxy
Run
v2ray-docker-compose/utils/bbr.sh
to speed up server network.copy
v2ray
folder andvmess.py
file to desired folder fromv2ray-docker-compose/v2ray-caddy-cdn/
.Generate a UUID via
cat /proc/sys/kernel/random/uuid
Replace
<UPSTREAM-UUID>
inv2ray/config/config.json
with the generated UUID.replace
domain = caddy[:caddy.find(' {')]
invmess.py
todomain = <YOUR-DOMAIN>
.
ShadowSocks vmess installation
create a
docker-compose.yml
file, open with text editor and paste the following:version: '3.3' networks: default: name: 'proxy_network' services: caddy: image: "lucaslorentz/caddy-docker-proxy:ci-alpine" ports: - "80:80" - "80:80/udp" - "443:443" - "443:443/udp" volumes: - /var/run/docker.sock:/var/run/docker.sock:ro - /srv/caddy/:/data restart: unless-stopped environment: - CADDY_INGRESS_NETWORKS=proxy_network v2ray: image: ghcr.io/getimages/v2fly-core:v4.45.2 restart: always environment: - v2ray.vmess.aead.forced=false volumes: - ./v2ray/config/:/etc/v2ray/ - ./v2ray/logs:/var/log/v2ray/ ports: - "127.0.0.1:1310:1310" - "127.0.0.1:1310:1310/udp" labels: caddy: http://<YOUR-DOMAIN> caddy.reverse_proxy: "http://v2ray:1310"
Don’t forget to replace
<YOUR-DOMAIN>
to your domain name.Run
docker compose up -d
.In your CDN, turn the proxy option on for the record.
Run
python3 ./vmess.py
to generate client configuration (link).
you may want to allow ports 80 (tcp + udp) and 443 (tcp + udp) in your server firewall.
How to connect
copy the generated link and import it as a configuration url in the client application.
Client Applications
This is the list of recommended applications to use the VMESS protocol:
- Nekoray for Windows, and Linux.
- Nekobox for Android
- v2rayNG for Android
- Nekoray - macOS for MacOS
- ShadowLink for iOS