Skip to content
This repository was archived by the owner on Apr 5, 2026. It is now read-only.
This repository was archived by the owner on Apr 5, 2026. It is now read-only.

Docker: print ready-to-share connection links at startup #55

@dvershinin

Description

@dvershinin

Feature Request

Requested by @PentiumB in #41

When the container starts, print the complete tg://proxy connection link(s) in the Docker logs so users can just copy-paste and share.

Current Behavior

Starting MTProxy with command: ./mtproto-proxy -p 8888 -H 443 -S bff6d195... -D www.google.com ...

Users must manually construct the connection link by hex-encoding the domain and concatenating with the secret.

Proposed Behavior

Starting MTProxy with command: ./mtproto-proxy ...

======================================
  MTProxy connection links:
  
  https://t.me/proxy?server=144.x.x.x&port=443&secret=eebff6d195d4f41b4c04c9d28f136c341f7777772e676f6f676c652e636f6d

  (or tg://proxy?server=144.x.x.x&port=443&secret=eebff6d195d4f41b4c04c9d28f136c341f7777772e676f6f676c652e636f6d)
======================================

Implementation

In start.sh, after building the command and detecting EXTERNAL_IP:

# Build the full secret for connection links
if [ -n "$EE_DOMAIN" ]; then
    DOMAIN_HEX=$(printf '%s' "$EE_DOMAIN" | xxd -ps | tr -d '\n')
    FULL_SECRET="ee${SECRET}${DOMAIN_HEX}"
elif [ "$RANDOM_PADDING" = "true" ]; then
    FULL_SECRET="dd${SECRET}"
else
    FULL_SECRET="$SECRET"
fi

CONNECT_HOST="${EXTERNAL_IP:-<YOUR_SERVER_IP>}"
CONNECT_PORT="${PORT:-443}"

echo ""
echo "======================================"
echo "  MTProxy connection link:"
echo ""
echo "  https://t.me/proxy?server=${CONNECT_HOST}&port=${CONNECT_PORT}&secret=${FULL_SECRET}"
echo ""
echo "======================================"

Notes

  • If multiple secrets are configured (Docker: support multiple secrets via environment variable #54), print one link per secret
  • If EXTERNAL_IP could not be detected, show placeholder with instruction
  • The xxd command is already available (we install vim-common)
  • telemt prints connection links at startup — users find this very convenient

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions