Skip to content

v0.23.2

Choose a tag to compare

@sleep3r sleep3r released this 11 May 13:19
c5a309f

0.23.2 (2026-05-11)

🇷🇺 Что нового (RU)

Что решает этот релиз

v0.23.2 - patch-релиз для MiddleProxy media path, особенно для tunnel/NAT конфигураций.

По issue #249 выяснились две отдельные проблемы:

  1. В нашем fallback path был реальный баг для dc_idx=203: если MiddleProxy endpoint и direct fallback совпадали по адресу (...:443), proxy мог попробовать отправить direct DC nonce в уже отвергнутый/полузакрытый MP-сокет вместо нового подключения.
  2. [server].public_ip использовался не только как входящий адрес для клиентских ссылок, но и как fallback для MiddleProxy NAT translation. В tunnel-сценариях это ломало media: клиенты подключались к одному IP, а исходящий трафик к Telegram уходил через другой egress IP.

В результате у операторов появлялся неприятный выбор: поставить public_ip сервера и получить рабочую ссылку, но сломанный media path; или поставить egress IP туннеля и починить media, но ухудшить подключение клиентов.

Теперь эти два понятия разделены.

[!IMPORTANT]
Если proxy ходит к Telegram через VPN/NAT egress, а клиенты подключаются к другому IP, используйте отдельный параметр:

[server]
public_ip = "IP_сервера_для_клиентов"
middle_proxy_nat_ip = "IP_egress_к_Telegram"

[!NOTE]
Обычные direct deployments без отдельного tunnel/NAT egress обычно не требуют изменений конфига.

Что изменено

Исправлен fallback после MiddleProxy handshake failure (#255)

  • Fallback больше не пишет direct nonce в текущий MP-сокет после failed handshake.
  • Даже если direct fallback endpoint совпадает с текущим endpoint (важно для DC203), proxy закрывает старый upstream socket и открывает новое direct-подключение.
  • Добавлен regression test на случай, где dc_idx=203 имеет одинаковый MP endpoint и direct fallback.

public_ip больше не используется как MiddleProxy NAT IP (#257)

  • [server].public_ip теперь трактуется как входящий адрес/domain для клиентских ссылок.
  • MiddleProxy NAT IP выбирается отдельно:
    • сначала [server].middle_proxy_nat_ip;
    • затем auto-detected AWG endpoint;
    • затем независимый public egress probe.
  • Добавлен отдельный модуль middle_proxy_nat.zig с тестами выбора NAT IP.
  • mtbuddy config теперь показывает middle_proxy_nat_ip, если он задан.
  • README и config.toml.example обновлены, чтобы явно разделить inbound client IP и outbound Telegram egress IP.

Проверено

  • zig build test --summary all
  • CI Test & Build
  • CI E2E Integration
  • CI Bench (No Soak)

🇬🇧 Release notes (EN)

What this release addresses

v0.23.2 is a patch release for the MiddleProxy media path, especially for tunnel/NAT deployments.

Issue #249 exposed two separate problems:

  1. The direct fallback path had a real bug for dc_idx=203: when the MiddleProxy endpoint and direct fallback endpoint were the same (...:443), the proxy could send a direct DC nonce into an already rejected/half-closed MP socket instead of opening a fresh connection.
  2. [server].public_ip was used both as the inbound address for client links and as a fallback source for MiddleProxy NAT translation. In tunnel setups, clients connect to one IP while Telegram sees a different outbound egress IP.

This forced operators into a bad tradeoff: use the server IP and get working client links but broken media, or use the tunnel egress IP and restore media while making client connections worse.

These two concepts are now separated.

[!IMPORTANT]
If proxy traffic reaches Telegram through a VPN/NAT egress while clients connect to a different IP, configure both values explicitly:

[server]
public_ip = "CLIENT_FACING_SERVER_IP"
middle_proxy_nat_ip = "TELEGRAM_EGRESS_IP"

[!NOTE]
Regular direct deployments without a separate tunnel/NAT egress usually do not need config changes.

What changed

Fixed fallback after MiddleProxy handshake failure (#255)

  • Fallback no longer sends a direct nonce into the current MP socket after a failed handshake.
  • Even when the direct fallback endpoint is the same as the current endpoint (important for DC203), the proxy closes the old upstream socket and opens a fresh direct connection.
  • Added regression coverage for the DC203 same-endpoint fallback case.

public_ip is no longer used as MiddleProxy NAT IP (#257)

  • [server].public_ip is now treated as the inbound address/domain used in client links.
  • MiddleProxy NAT IP is selected separately:
    • explicit [server].middle_proxy_nat_ip;
    • auto-detected AWG endpoint;
    • independent public egress probe.
  • Added a dedicated middle_proxy_nat.zig module with NAT IP selection tests.
  • mtbuddy config now prints middle_proxy_nat_ip when configured.
  • README and config.toml.example now clearly separate inbound client IP from outbound Telegram egress IP.

Verified

  • zig build test --summary all
  • CI Test & Build
  • CI E2E Integration
  • CI Bench (No Soak)

Changelog

  • fix: reconnect direct fallback after middleproxy handshake failure (#255) (9bd2e88)
  • fix: decouple MiddleProxy NAT IP from public_ip (#257) (d247ab9)
  • chore(main): release 0.23.2 (#256)