Telegram released the official MTProto Proxy Server

Finally, after waiting, after close scrutiny and reverse engineering of the MTProto Proxy protocol, Telegram decided to release the official version, with the support of
What is MTProto Proxy?
This is a specific proxy server and protocol from the creators of Telegram that allows you to bypass locks and monetize its use.
Official proxy
In the last publication was presented a lot of informal implementations of the proxy server, many of them are written by Habr users.
Now we have the official version:
github.com/TelegramMessenger/MTProxy
hub.docker.com/r/telegrammessenger/proxy
What can he do?
- Supports up to 16 different keys on 1 proxy
- Up to 60,000 connections per core
- Has an API to collect statistics (only available locally)
- Ready Docker Image
- Show Promoted Channels
How to setup?
To disgrace simply:
docker run -d -p443:443 --name=mtproto-proxy --restart=always -v proxy-config:/data telegrammessenger/proxy:latest
After this we do:
docker logs mtproto-proxy
As output you will get:
######## Telegram Proxy####
[+] No secret passed. Will generate 1 random ones.
[*] Final configuration:
[*] Secret 1: afajkfhjksajkahkhkjkkk
[*] tg:// link for secret 1 auto configuration: tg://proxy?server=127.0.0.1&port=443&secret= afajkfhjksajkahkhkjkkk
[*] t.me link for secret 1: https://t.me/proxy?server=127.0.0.1&port=443&secret= afajkfhjksajkahkhkjkkk
[*] Tag: no tag
[*] External IP: 127.0.0.1
[*] Make sure to fix the links incase you run the proxy on a different port.
[+] Starting proxy...
The basic setting itself is complete.
Show Promoted Channel
If you want to show the channel when connecting to a proxy, you need to register the proxy:
The official @ MTProxybot bot will help with this .
He should send an IP: Port + key, in return you will receive an advertising tag.
This tag must be passed as a parameter when the container is started:
docker run -d -p443:443 --name=mtproto-proxy --restart=always -v proxy-config:/data -e TAG=ВАШ_TAG telegrammessenger/proxy:latest
Next, we return to the bot, select our proxy and “Set promotion” - now it remains only to send any channel to display.
That's all, now you have an official Telegram Proxy with the Promotion channel, which will be shown to all users.
Additional settings
By default, the key will be automatically generated at startup and saved in the Docker volume, if you want you can specify another key:
-e SECRET = 00baadf00d15abad1deaa51sbaadcafe
Or a few:
А можете попросить сгенерировать вам несколько ключей:
По умолчанию запускает 2 worker'a, изменить настройку можно следующим образом:
WORKERS=16
Мониторинг доступен по адресу: localhost:2398/stats
Получить статистику можно следующим образом:
ready_targets: Количество Telegram серверов которые готовы обслужить запросы с прокси
active_targets: Количество Telegram серверов обслуживающие запросы с прокси
total_special_connections: Количество входящих соединений
total_max_special_connections: Лимит входящих соединений
-e SECRET = 00baadf00d15abad1deaa51sbaadcafe
docker run -d -p443:443 -v proxy-config:/data -e SECRET=00baadf00d15abad1deaa51sbaadcafe telegrammessenger/proxy:latest
Or a few:
docker run -d -p443:443 -v proxy-config:/data -e SECRET=935ddceb2f6bbbb78363b224099f75c8,2084c7e58d8213296a3206da70356c81 telegrammessenger/proxy:latest
А можете попросить сгенерировать вам несколько ключей:
docker run -d -p443:443 -v proxy-config:/data -e SECRET_COUNT=4 telegrammessenger/proxy:latest
По умолчанию запускает 2 worker'a, изменить настройку можно следующим образом:
WORKERS=16
docker run -d -p443:443 -v proxy-config:/data -e WORKERS=16 telegrammessenger/proxy:latest
Мониторинг доступен по адресу: localhost:2398/stats
Получить статистику можно следующим образом:
docker exec mtproto-proxy curl http://localhost:2398/stats
ready_targets: Количество Telegram серверов которые готовы обслужить запросы с прокси
active_targets: Количество Telegram серверов обслуживающие запросы с прокси
total_special_connections: Количество входящих соединений
total_max_special_connections: Лимит входящих соединений
The bot can also show usage statistics for your proxy:

docker-compose
Instead of writing long commands in one line, you can use docker-compose .