Skip to content

Очередное не грузится медиа на нон-премиум аккаунтах #366

Description

@MaxiJazzer

Proxy version

1.4.4

OS & kernel

Linux 6.8.0-124-generic

Telegram client & version

12.8.1

Pre-flight checklist

  • I am running the latest release (checked Releases).
  • System clock is synchronized (timedatectl status shows NTP synchronized: yes).
  • The proxy port (default 443) is open in the firewall (ss -tlnp | grep <port> shows LISTEN).
  • I can reach the proxy port from the outside (curl -v --connect-timeout 5 https://<server-ip>:<port> returns a TLS error, not a timeout).
  • Secret key in config.toml matches the tg:// link I use on the client (I re-checked byte-for-byte).
  • RLIMIT_NOFILE warning (if present) is just a warning — I understand it does not block connections.
  • I have read the logs with journalctl -u mtproto-proxy -n 200 --no-pager and the full output is attached below.

config.toml (secrets redacted)

[server]
public_ip = 'my_public_ip'
middle_proxy_nat_ip = my_wg_link_ip
port = 443
max_connections = 512
idle_timeout_sec = 120
handshake_timeout_sec = 15
handshake_flood_guard_enabled = false
handshake_flood_guard_threshold = 20
handshake_flood_guard_window_sec = 30
handshake_flood_guard_block_sec = 120
tag = "my_tag_from_bot"

[upstream]
type = "tunnel"

[censorship]
tls_domain = "rutube.ru"
mask = true
desync = true
drs = false
fast_mode = false
mask_port = 8444

[general]
use_middle_proxy = true

[access.users]
user = "user_id"

Full proxy log (last 200 lines)

Jun 16 09:29:28 epd2ulc3m22vhm0sf80r mtproto-proxy[71578]:       proxy · zig edition · v1.4.4
Jun 16 09:29:28 epd2ulc3m22vhm0sf80r mtproto-proxy[71578]:       keeping your people connected
Jun 16 09:29:28 epd2ulc3m22vhm0sf80r mtproto-proxy[71578]:   ─── SERVER ──────────────────────────────────────
Jun 16 09:29:28 epd2ulc3m22vhm0sf80r mtproto-proxy[71578]:       Listen       0.0.0.0:443
Jun 16 09:29:28 epd2ulc3m22vhm0sf80r mtproto-proxy[71578]:       Public IP    'MY IP'
Jun 16 09:29:28 epd2ulc3m22vhm0sf80r mtproto-proxy[71578]:       TLS Domain   rutube.ru
Jun 16 09:29:28 epd2ulc3m22vhm0sf80r mtproto-proxy[71578]:       Masking      enabled
Jun 16 09:29:28 epd2ulc3m22vhm0sf80r mtproto-proxy[71578]:   ─── CAPACITY ────────────────────────────────────
Jun 16 09:29:28 epd2ulc3m22vhm0sf80r mtproto-proxy[71578]:       Host RAM     1966 MiB
Jun 16 09:29:28 epd2ulc3m22vhm0sf80r mtproto-proxy[71578]:       Per conn     ~4104 KiB (middleproxy mode)
Jun 16 09:29:28 epd2ulc3m22vhm0sf80r mtproto-proxy[71578]:       Safe cap     ~278 connections
Jun 16 09:29:28 epd2ulc3m22vhm0sf80r mtproto-proxy[71578]:   ─── USERS (1) ────────────────────────────────────
Jun 16 09:29:28 epd2ulc3m22vhm0sf80r mtproto-proxy[71578]:       ● user
Jun 16 09:29:28 epd2ulc3m22vhm0sf80r mtproto-proxy[71578]:   ─── SECURITY ───────────────────────────────────
Jun 16 09:29:28 epd2ulc3m22vhm0sf80r mtproto-proxy[71578]:       User secrets and proxy links are hidden in runtime logs.
Jun 16 09:29:28 epd2ulc3m22vhm0sf80r mtproto-proxy[71578]:       Use mtbuddy install output or trusted local tooling to generate links.
Jun 16 09:29:28 epd2ulc3m22vhm0sf80r mtproto-proxy[71578]:   ──────────────────────────────────────────────────
Jun 16 09:29:28 epd2ulc3m22vhm0sf80r mtproto-proxy[71578]:   ⏳ Your door is open. Waiting for the people you love...
Jun 16 09:29:28 epd2ulc3m22vhm0sf80r mtproto-proxy[71578]: info(proxy): mask_port=8444 configured, using local mask target 127.0.0.1
Jun 16 09:29:28 epd2ulc3m22vhm0sf80r mtproto-proxy[71578]: info(proxy): Mask target '127.0.0.1:8444' resolved at startup
Jun 16 09:29:28 epd2ulc3m22vhm0sf80r mtproto-proxy[71578]: info(proxy): Using server.middle_proxy_nat_ip for middle-proxy NAT translation: WIREGUARD_IP
Jun 16 09:29:28 epd2ulc3m22vhm0sf80r mtproto-proxy[71578]: info(proxy): Upstream mode: tunnel (socket policy routing via SO_MARK=200)
Jun 16 09:29:28 epd2ulc3m22vhm0sf80r mtproto-proxy[71578]: info(proxy): Listening on [::]:443 (epoll)
Jun 16 09:29:28 epd2ulc3m22vhm0sf80r mtproto-proxy[71578]: info(proxy): client ClientHello [ciphers=1301,1302,1303,c02b,c02f,c02c,c030,cca9,cca8,c013,c014,009c,009d,002f,0035 groups=caca,11ec,001d,0017,0018 keyshare=caca,11ec,001d] (we serve: cipher echoes client, key_share=x25519 0x001d)
Jun 16 09:29:29 epd2ulc3m22vhm0sf80r mtproto-proxy[71578]: warning(proxy): [0] middle-proxy handshake failed, reconnecting direct to [ipv4]:443
Jun 16 09:29:31 epd2ulc3m22vhm0sf80r mtproto-proxy[71578]: info(proxy): client ClientHello [ciphers=1301,1302,1303,c02b,c02f,c02c,c030,cca9,cca8,c013,c014,009c,009d,002f,0035 groups=caca,11ec,001d,0017,0018 keyshare=caca,11ec,001d] (we serve: cipher echoes client, key_share=x25519 0x001d)
Jun 16 09:29:32 epd2ulc3m22vhm0sf80r mtproto-proxy[71578]: info(proxy): client ClientHello [ciphers=1301,1302,1303,c02b,c02f,c02c,c030,cca9,cca8,c013,c014,009c,009d,002f,0035 groups=caca,11ec,001d,0017,0018 keyshare=caca,11ec,001d] (we serve: cipher echoes client, key_share=x25519 0x001d)
Jun 16 09:29:38 epd2ulc3m22vhm0sf80r mtproto-proxy[71578]: info(proxy): client ClientHello [ciphers=1301,1302,1303,c02b,c02f,c02c,c030,cca9,cca8,c013,c014,009c,009d,002f,0035 groups=caca,11ec,001d,0017,0018 keyshare=caca,11ec,001d] (we serve: cipher echoes client, key_share=x25519 0x001d)
Jun 16 09:29:38 epd2ulc3m22vhm0sf80r mtproto-proxy[71578]: info(proxy): client ClientHello [ciphers=1301,1302,1303,c02b,c02f,c02c,c030,cca9,cca8,c013,c014,009c,009d,002f,0035 groups=caca,11ec,001d,0017,0018 keyshare=caca,11ec,001d] (we serve: cipher echoes client, key_share=x25519 0x001d)
Jun 16 09:29:38 epd2ulc3m22vhm0sf80r mtproto-proxy[71578]: info(proxy): conn stats: active=6/278 hs_inflight=5 accepted+=99 closed+=93 tracked_fds=12 total=99 paused=false/false users_total=5 unassigned=1 users{user=5}
Jun 16 09:29:38 epd2ulc3m22vhm0sf80r mtproto-proxy[71578]: info(proxy):   drops: cap+=0 sat+=0 rate+=0 flood_guard+=0 hs_budget+=0 hs_timeout+=0 mp_fallback+=1 pool+=0
Jun 16 09:29:38 epd2ulc3m22vhm0sf80r mtproto-proxy[71578]: warning(proxy): ad-tag likely inactive: 1 middle-proxy handshake(s) fell back to direct this interval — those connections carry no ad-tag/ME media. Check egress reachability and [server].middle_proxy_nat_ip.
Jun 16 09:29:46 epd2ulc3m22vhm0sf80r mtproto-proxy[71578]: info(proxy): client ClientHello [ciphers=1301,1302,1303,c02b,c02f,c02c,c030,cca9,cca8,c013,c014,009c,009d,002f,0035 groups=caca,11ec,001d,0017,0018 keyshare=caca,11ec,001d] (we serve: cipher echoes client, key_share=x25519 0x001d)
Jun 16 09:29:46 epd2ulc3m22vhm0sf80r mtproto-proxy[71578]: info(proxy): client ClientHello [ciphers=1301,1302,1303,c02b,c02f,c02c,c030,cca9,cca8,c013,c014,009c,009d,002f,0035 groups=caca,11ec,001d,0017,0018 keyshare=caca,11ec,001d] (we serve: cipher echoes client, key_share=x25519 0x001d)
Jun 16 09:29:46 epd2ulc3m22vhm0sf80r mtproto-proxy[71578]: info(proxy): client ClientHello [ciphers=1301,1302,1303,c02b,c02f,c02c,c030,cca9,cca8,c013,c014,009c,009d,002f,0035 groups=caca,11ec,001d,0017,0018 keyshare=caca,11ec,001d] (we serve: cipher echoes client, key_share=x25519 0x001d)
Jun 16 09:29:47 epd2ulc3m22vhm0sf80r mtproto-proxy[71578]: warning(proxy): [171] middle-proxy handshake failed, reconnecting direct to [ipv4]:443
Jun 16 09:29:47 epd2ulc3m22vhm0sf80r mtproto-proxy[71578]: info(proxy): client ClientHello [ciphers=1301,1302,1303,c02b,c02f,c02c,c030,cca9,cca8,c013,c014,009c,009d,002f,0035 groups=caca,11ec,001d,0017,0018 keyshare=caca,11ec,001d] (we serve: cipher echoes client, key_share=x25519 0x001d)
Jun 16 09:29:47 epd2ulc3m22vhm0sf80r mtproto-proxy[71578]: warning(proxy): [176] middle-proxy handshake failed, reconnecting direct to [ipv4]:443
Jun 16 09:29:47 epd2ulc3m22vhm0sf80r mtproto-proxy[71578]: warning(proxy): [175] middle-proxy handshake failed, reconnecting direct to [ipv4]:443
Jun 16 09:29:47 epd2ulc3m22vhm0sf80r mtproto-proxy[71578]: info(proxy): client ClientHello [ciphers=1301,1302,1303,c02b,c02f,c02c,c030,cca9,cca8,c013,c014,009c,009d,002f,0035 groups=caca,11ec,001d,0017,0018 keyshare=caca,11ec,001d] (we serve: cipher echoes client, key_share=x25519 0x001d)
Jun 16 09:29:47 epd2ulc3m22vhm0sf80r mtproto-proxy[71578]: info(proxy): client ClientHello [ciphers=1301,1302,1303,c02b,c02f,c02c,c030,cca9,cca8,c013,c014,009c,009d,002f,0035 groups=caca,11ec,001d,0017,0018 keyshare=caca,11ec,001d] (we serve: cipher echoes client, key_share=x25519 0x001d)
Jun 16 09:29:48 epd2ulc3m22vhm0sf80r mtproto-proxy[71578]: info(proxy): conn stats: active=6/278 hs_inflight=3 accepted+=102 closed+=102 tracked_fds=12 total=201 paused=false/false users_total=6 unassigned=0 users{user=6}
Jun 16 09:29:48 epd2ulc3m22vhm0sf80r mtproto-proxy[71578]: info(proxy):   drops: cap+=0 sat+=0 rate+=0 flood_guard+=0 hs_budget+=0 hs_timeout+=2 mp_fallback+=3 pool+=0
Jun 16 09:29:48 epd2ulc3m22vhm0sf80r mtproto-proxy[71578]: warning(proxy): ad-tag likely inactive: 3 middle-proxy handshake(s) fell back to direct this interval — those connections carry no ad-tag/ME media. Check egress reachability and [server].middle_proxy_nat_ip.
Jun 16 09:29:48 epd2ulc3m22vhm0sf80r mtproto-proxy[71578]: warning(proxy): [188] middle-proxy handshake failed, reconnecting direct to [ipv4]:443
Jun 16 09:29:49 epd2ulc3m22vhm0sf80r mtproto-proxy[71578]: info(proxy): client ClientHello [ciphers=1301,1302,1303,c02b,c02f,c02c,c030,cca9,cca8,c013,c014,009c,009d,002f,0035 groups=caca,11ec,001d,0017,0018 keyshare=caca,11ec,001d] (we serve: cipher echoes client, key_share=x25519 0x001d)
Jun 16 09:29:50 epd2ulc3m22vhm0sf80r mtproto-proxy[71578]: warning(proxy): [205] middle-proxy handshake failed, reconnecting direct to [ipv4]:443
Jun 16 09:29:51 epd2ulc3m22vhm0sf80r mtproto-proxy[71578]: info(proxy): client ClientHello [ciphers=1301,1302,1303,c02b,c02f,c02c,c030,cca9,cca8,c013,c014,009c,009d,002f,0035 groups=caca,11ec,001d,0017,0018 keyshare=caca,11ec,001d] (we serve: cipher echoes client, key_share=x25519 0x001d)

Diagnostics output

echo "=== systemctl ===" && systemctl status mtproto-proxy --no-pager -l 2>/dev/null || echo "N/A"
=== date ===
Tue Jun 16 09:31:46 UTC 2026
=== timedatectl ===
               Local time: Tue 2026-06-16 09:31:46 UTC
           Universal time: Tue 2026-06-16 09:31:46 UTC
                 RTC time: Tue 2026-06-16 09:31:46
                Time zone: Etc/UTC (UTC, +0000)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no
=== ulimit ===
1024
=== ss ===
LISTEN 0      4096               *:443              *:*    users:(("mtproto-proxy",pid=71578,fd=4))
LISTEN 0      4096               *:8443             *:*    users:(("xray-linux-amd6",pid=1223,fd=7))
=== uname ===
Linux epd2ulc3m22vhm0sf80r 6.8.0-124-generic #124-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 13:00:45 UTC 2026 x86_64 x86_64 x86_64 GNU/Linux
=== memory ===
               total        used        free      shared  buff/cache   available
Mem:           1.9Gi       484Mi       960Mi       1.3Mi       673Mi       1.4Gi
Swap:             0B          0B          0B
=== systemctl ===
● mtproto-proxy.service - MTProto Proxy (Zig) via Tunnel Policy Routing
     Loaded: loaded (/etc/systemd/system/mtproto-proxy.service; enabled; preset: enabled)
    Drop-In: /etc/systemd/system/mtproto-proxy.service.d
             └─10-nginx.conf
     Active: active (running) since Tue 2026-06-16 09:29:28 UTC; 2min 18s ago
       Docs: https://github.com/sleep3r/mtproto.zig
    Process: 71503 ExecStartPre=/usr/local/bin/setup_tunnel.sh (code=exited, status=0/SUCCESS)
   Main PID: 71578 (mtproto-proxy)
      Tasks: 3 (limit: 65535)
     Memory: 6.5M (peak: 7.0M)
        CPU: 640ms
     CGroup: /system.slice/mtproto-proxy.service
             ├─71578 /opt/mtproto-proxy/mtproto-proxy /opt/mtproto-proxy/config.toml
             └─72874 curl --silent --fail --show-error --location --max-redirs 3 --proto =https --proto-redir =https --max-time 10 --interface awg17 https://core.telegram.org/getProxyConfig

Jun 16 09:30:48 epd2ulc3m22vhm0sf80r mtproto-proxy[71578]: info(proxy): conn stats: active=5/278 hs_inflight=1 accepted+=95 closed+=96 tracked_fds=10 total=722 paused=false/false users_total=5 unassigned=0 users{user=5}
Jun 16 09:30:58 epd2ulc3m22vhm0sf80r mtproto-proxy[71578]: info(proxy): conn stats: active=5/278 hs_infli

Additional context

Не могу понять в чем причина. Почитал, что нужно обязательно настраивать use_middle_proxy = true, сделал.
Зарегистрировал через @MTProxybot свою прокси, тэг вставил в конфиг
Через mtbuddy setup egress 'wireguard://' устанавливаю подключение через вг. (В конфиге вписал middle_proxy_nat_ip = айпи_ваергард сервера )
Премиум юзеры работают идеально, нон-премиум только текстовый режим. На не-премиум даже стикеры не грузятся.

Где я допустил ошибку? Очень нужна помощь.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions