You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 5, 2026. It is now read-only.
Add a mode where the proxy connects directly to Telegram DCs instead of going through Telegram's middle-end proxy relay servers (listed in proxy-multi.conf).
Current Architecture
Client → MTProxy → Telegram ME relay (proxy-multi.conf) → Telegram DC
The middle-end (ME) relay servers handle DC routing and enable ad tags (-P proxy tag). But they add an extra network hop.
Proposed Architecture (direct mode)
Client → MTProxy → Telegram DC (direct)
Benefits
Lower latency: One fewer network hop
No dependency on proxy-multi.conf: DC addresses are well-known and stable (149.154.175.0/24, etc.)
No dependency on core.telegram.org: Eliminates the startup/refresh download of proxy-multi.conf
Simpler deployment: No cron job needed for config refresh
Trade-offs
No ad tag support: Promoted channels (-P flag) require the ME relay
DC routing: The proxy must parse the MTProto stream to determine which DC the client wants, and handle DC migration
Potentially less reliable: Telegram's ME relays may handle load balancing and failover
Prior Art
mtg v2: Connects directly to Telegram DCs by default. Explicitly removed ad tag support and ME relay dependency to simplify architecture.
telemt: Supports both modes (ME relay with ad tags, and direct)
Implementation Notes
Could be toggled via --direct flag or activated when -P (proxy tag) is not specified
Feature Request
Requested by @PentiumB in #41
Add a mode where the proxy connects directly to Telegram DCs instead of going through Telegram's middle-end proxy relay servers (listed in
proxy-multi.conf).Current Architecture
The middle-end (ME) relay servers handle DC routing and enable ad tags (
-Pproxy tag). But they add an extra network hop.Proposed Architecture (direct mode)
Benefits
Trade-offs
-Pflag) require the ME relayPrior Art
Implementation Notes
--directflag or activated when-P(proxy tag) is not specified149.154.175.50(DC1),149.154.167.51(DC2),149.154.175.100(DC3),149.154.167.91(DC4),91.108.56.100(DC5)