Based on instructions from rameerez/telegram-mtproxy.md gist, but with the original image's entry script.
Third-party files:
- Community fork of MTProxy
- file
run.sh
as is from Telegram's official MTProto docker container filerandr_compat.patch
from https://github.com/alexdoesh/mtproxy/blob/master/patches/randr_compat.patch
Simply run docker build --tag mtproto-proxy .
. Optionally you can use CURL_ARGS
variable (see Dockerfile comments).
You will need Linx machine with public IP address.
- Generate secret:
head -c 16 /dev/urandom | xxd -ps
- Go to @MTProxybot bot and register your proxy by providing external ip and port. Use
curl ifconfig.co/ip
to find your external IP. - Launch container with secret from step 1 and tag received in step 2:
docker run -d -p8443:443 --name=mtproto-proxy --restart=always -v proxy-config:/data -e SECRET=<generated secret from 1 step> -e TAG=<tag from step 2> mtproto-proxy
This is how mtproto-proxy process is runned inside container from run.sh script:
/usr/local/bin/mtproto-proxy -p 2398 -H 443 -M 2 -C 60000 --aes-pwd /etc/telegram/hello-explorers-how-are-you-doing -u root /etc/telegram/backend.conf --allow-skip-dh --nat-info 172.17.0.2 159.54.175.154 -S d2accd57d2ec269f22a98af8b1ac2bfc -P 6e4513d09e87af1264a0b0780fa9f952
PS. I've tried to run mtproxy on Alpine (see Dockerfile.alpine
) but there is issues with result binary - it cannot find some libraries.