A Docker container with tg-ws-proxy from Flowseal, with some improvements for my own convenience.
10K+
Source code: https://github.com/LordArrin/tg-ws-proxy-docker
Docker image for personal use. All credits to original author https://github.com/Flowseal/tg-ws-proxy
I just made a few improvements for my own comfort:
| Args | Default | Description |
|---|---|---|
PROXY_PORT | 1443 | Proxy port |
PROXY_HOST | 0.0.0.0 | Proxy host |
PROXY_SECRET | random | 32 hex characters secret for client authorization. (Command to generate: openssl rand -hex 16) |
PROXY_DC_IPS | 2:149.154.167.220 4:149.154.167.220 | Target IP of Telegram's data centers |
PROXY_BUF | 4096 | Buffer size in KB |
PROXY_POOL_SIZE | 2 | The number of prepared connections for each DC |
NO_CFPROXY | false | Disable Cloudflare proxying attempt. Read more here |
CFPROXY_DOMAIN | Specify your domain for proxying through Cloudflare. Read more here | |
CFPROXY_WORKER_DOMAIN | Specify your CF worker for proxying through Cloudflare. | |
KEEPALIVE | false | Enable WS keepalive pings to prevent connections from closing when idle. Experimental option, disabled by default. Requires configuring CF worker for this to work. |
SOCKS_ENABLED | false | Enable the built-in SOCKS5 proxy with traffic tunneling through CF worker. |
SOCKS_PORT | 1080 | The port on which the SOCKS5 proxy listens. |
SOCKS_HOST | 0.0.0.0 | The host on which the SOCKS5 proxy listens. |
SOCKS_USER | (Optional) The username for SOCKS5 authentication. If specified together with SOCKS_PASS, authentication becomes strictly required. | |
SOCKS_PASS | (Optional) The password for SOCKS5 authentication. | |
SOCKS_CONNECT_TIMEOUT | 10 | Timeout for establishing a WebSocket connection with CF worker (in seconds). |
Example config:
services:
tg-ws-proxy:
image: lordarrin/tg-ws-proxy:latest
container_name: tg-ws-proxy
restart: unless-stopped
network_mode: host
environment:
- PROXY_HOST=192.168.1.1
- PROXY_PORT=****1
- PROXY_SECRET=
- CFPROXY_WORKER_DOMAIN=rough-unit-*.*.workers.dev
- KEEPALIVE=true
- SOCKS_ENABLED=true
- SOCKS_HOST=192.168.1.1
- SOCKS_PORT=****2
- SOCKS_USER=***
- SOCKS_PASS=***
security_opt:
- no-new-privileges:true
read_only: true
tmpfs:
- /tmp:noexec,nosuid,size=64m
- /home/app/.cache:noexec,nosuid,size=32m
deploy:
resources:
limits:
memory: 384M
cpus: '1'
To generate a secret you can use:
openssl rand -hex 16
192.168.1.1 (or your own)1443 (or your own)Content type
Image
Digest
sha256:bf09fb25f…
Size
31.8 MB
Last updated
4 days ago
docker pull lordarrin/tg-ws-proxy