Two issues found in run.sh
1. Port in generated links is hardcoded to 443
When running the proxy on a non-standard port (e.g. docker run -p 2053:443 ...),
the generated tg:// and t.me/ links in the logs always show port=443:
echo "[*] tg:// link for secret $I auto configuration: tg://proxy?server=${IP}&port=443&secret=${S}"
This is misleading — users have to manually fix the port in every link.
Suggested fix: introduce a PORT environment variable (defaulting to 443) and use it in the link generation:
if [ -z "$PORT" ]; then PORT=443; fi
# ...
echo "[*] tg:// link for secret $I: tg://proxy?server=${IP}&port=${PORT}&secret=${S}"
2. HTTP stats endpoint is not enabled by default
The proxy binary supports an --http-stats flag that enables HTTP access to the
/stats endpoint on port 2398. Without it, the port is open for internal RPC only
and curl http://localhost:2398/stats always returns Connection refused.
The flag is not present in the final exec call in run.sh:
exec /usr/local/bin/mtproto-proxy -p 2398 -H 443 -M "$WORKERS" -C 60000 \
--aes-pwd ... -u root $CONFIG --allow-skip-dh \
--nat-info "$INTERNAL_IP:$IP" $SECRET_CMD $TAG_CMD
# ^ --http-stats is missing here
Suggested fix: either add --http-stats by default, or support an env variable
like HTTP_STATS=true to opt in.
Both issues are easy to reproduce with the official telegrammessenger/proxy:latest image.
Two issues found in run.sh
1. Port in generated links is hardcoded to 443
When running the proxy on a non-standard port (e.g.
docker run -p 2053:443 ...),the generated
tg://andt.me/links in the logs always showport=443:This is misleading — users have to manually fix the port in every link.
Suggested fix: introduce a
PORTenvironment variable (defaulting to443) and use it in the link generation:2. HTTP stats endpoint is not enabled by default
The proxy binary supports an
--http-statsflag that enables HTTP access to the/statsendpoint on port2398. Without it, the port is open for internal RPC onlyand
curl http://localhost:2398/statsalways returnsConnection refused.The flag is not present in the final
execcall inrun.sh:Suggested fix: either add
--http-statsby default, or support an env variablelike
HTTP_STATS=trueto opt in.Both issues are easy to reproduce with the official
telegrammessenger/proxy:latestimage.