Skip to content

Fix for MTProto proxy connection issues for RU users (iOS/Android/Desktop on one port) #696

Description

@Mekotofeuka

Since June 4, many MTProto proxy users from RU have been facing connection issues: clients fail to connect entirely — connection hangs at the TCP handshake stage and eventually gets blocked for ~2 minutes.

Some community workarounds that appeared on June 5 partially restore connectivity, but:

  • Connection takes 15–20+ seconds
  • With multiple devices from the same IP (office, Wi‑Fi, NAT), they queue up and the connection time grows significantly

I've developed a server-side fix that solves both problems. It's been tested on:

  • Telemt (3.4.18, the most stable version)
  • MTProto.zig
  • MTG
  • Original MTProto Proxy
  • JSMTProxy

Key improvements:

  • Fast connection in <3–8 seconds, even under load (original workarounds: 10–20+ seconds)
  • One port for all clients (iOS, Android, macOS, Desktop)
  • Media loads at near-original speed
  • One‑click installation
  • No MSS manipulation required

How it works

The script applies a two‑layer SYN filtering rule that separates devices into two groups — iOS and non‑iOS — applying different limits to each:

  1. iOS clients are detected by TTL+Length fingerprint and get a dedicated fast lane
  2. All other devices go through a separate per‑IP rate limit (54/minute = 1.1/sec)

This prevents iOS and Android/Desktop from interfering with each other when sharing the same IP (NAT, Wi‑Fi, office networks).

The fix also:

  • Uses REJECT instead of DROP, so clients get an instant response instead of waiting 3–5 seconds for a timeout
  • Disables built‑in MSS/synlimit in telemt config (they're not needed and only slow things down)

https://github.com/Mekotofeuka/MTPROTO_FIX_By_MEKO

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions