[GH-ISSUE #5537] [Question]: How to set up Telegram voice calls via a cascading proxy? #3864

Closed
opened 2026-10-31 20:35:30 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @JohniGo76 on GitHub (Jun 24, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5537

What are you trying to do?

How to set up a cascading proxy for voice calls in Telegram?

What have you already tried?

I've set up MTProxy inbound and traffic forwarding to an upstream proxy. Text messages get through, but voice calls only get as far as the key exchange.

3x-ui version

3.4.0

How did you install 3x-ui?

install.sh script

Operating system

Ubuntu 24.04

Screenshots or config snippets

Image

Before submitting

  • I read the Wiki and searched existing issues.
  • This is a usage question, not a bug report.
  • This question is written in English.
Originally created by @JohniGo76 on GitHub (Jun 24, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5537 ### What are you trying to do? How to set up a cascading proxy for voice calls in Telegram? ### What have you already tried? I've set up MTProxy inbound and traffic forwarding to an upstream proxy. Text messages get through, but voice calls only get as far as the key exchange. ### 3x-ui version 3.4.0 ### How did you install 3x-ui? install.sh script ### Operating system Ubuntu 24.04 ### Screenshots or config snippets <img width="797" height="749" alt="Image" src="https://github.com/user-attachments/assets/51b4c94f-f722-4323-b655-f781139e2267" /> ### Before submitting - [x] I read the [Wiki](https://github.com/MHSanaei/3x-ui/wiki) and searched [existing issues](../issues?q=is%3Aissue). - [x] This is a usage question, not a bug report. - [x] This question is written in English.
bsakaguchi 2026-10-31 20:35:30 +07:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@github-actions[bot] commented on GitHub (Jun 24, 2026):

The behavior you describe is a fundamental transport limitation of MTProxy (the mtg binary used by this panel), not a configuration problem.

Why text works but voice calls do not

mtg proxies Telegram's MTProto protocol over TCP only. The loopback SOCKS bridge that the "Route through Xray" option injects into the Xray config is also configured with UDP disabled — this is hardcoded in internal/web/service/xray.go:

const mtprotoEgressSocksSettings = `{"auth":"noauth","udp":false}`

The comment in that file is explicit: "mtg makes plain TCP connections, so UDP is left off."

Telegram voice (and video) calls use a two-phase flow:

  1. Signaling and key exchange — carried over MTProto (TCP) through your proxy chain. This completes successfully, which is why you see the key exchange reach its end.
  2. Media stream — carried over UDP, either peer-to-peer or through Telegram's TURN relay servers. MTProxy has no mechanism to tunnel UDP, so this phase never establishes, and the call drops or hangs after the key exchange.

Cascading a second upstream MTProxy does not change this: both hops still only carry TCP, so the UDP media stream remains unrouted regardless of the number of hops.

What will actually work for voice calls

You need a tunnel that carries arbitrary UDP traffic, not an MTProxy chain. The panel already supports protocols suited to this:

  • WireGuard inbound — a native kernel UDP VPN; configure a WireGuard inbound on your server and connect Telegram's system proxy (or the device's VPN) to it.
  • VLESS / VMess / Trojan with XUDP — Xray-core's XUDP extension allows UDP traffic to be forwarded over these protocols. Set up a VLESS/VMess inbound with a client-side Xray configuration that routes Telegram traffic (including UDP) outbound through your server.

The MTProxy inbound is appropriate for censorship circumvention of Telegram's text and file traffic only. It cannot be extended to cover voice calls through any cascade or routing configuration currently exposed by this panel, including the "Route through Xray" option.


This reply was generated automatically; a maintainer may follow up.

<!-- gh-comment-id:4789071845 --> @github-actions[bot] commented on GitHub (Jun 24, 2026): The behavior you describe is a fundamental transport limitation of MTProxy (the `mtg` binary used by this panel), not a configuration problem. **Why text works but voice calls do not** `mtg` proxies Telegram's MTProto protocol over **TCP only**. The loopback SOCKS bridge that the "Route through Xray" option injects into the Xray config is also configured with UDP disabled — this is hardcoded in `internal/web/service/xray.go`: ```go const mtprotoEgressSocksSettings = `{"auth":"noauth","udp":false}` ``` The comment in that file is explicit: *"mtg makes plain TCP connections, so UDP is left off."* Telegram voice (and video) calls use a two-phase flow: 1. **Signaling and key exchange** — carried over MTProto (TCP) through your proxy chain. This completes successfully, which is why you see the key exchange reach its end. 2. **Media stream** — carried over UDP, either peer-to-peer or through Telegram's TURN relay servers. MTProxy has no mechanism to tunnel UDP, so this phase never establishes, and the call drops or hangs after the key exchange. Cascading a second upstream MTProxy does not change this: both hops still only carry TCP, so the UDP media stream remains unrouted regardless of the number of hops. **What will actually work for voice calls** You need a tunnel that carries arbitrary UDP traffic, not an MTProxy chain. The panel already supports protocols suited to this: - **WireGuard inbound** — a native kernel UDP VPN; configure a WireGuard inbound on your server and connect Telegram's system proxy (or the device's VPN) to it. - **VLESS / VMess / Trojan with XUDP** — Xray-core's XUDP extension allows UDP traffic to be forwarded over these protocols. Set up a VLESS/VMess inbound with a client-side Xray configuration that routes Telegram traffic (including UDP) outbound through your server. The MTProxy inbound is appropriate for censorship circumvention of Telegram's text and file traffic only. It cannot be extended to cover voice calls through any cascade or routing configuration currently exposed by this panel, including the "Route through Xray" option. --- *This reply was generated automatically; a maintainer may follow up.*
Author
Owner

@JohniGo76 commented on GitHub (Jun 24, 2026):

I previously tried Mixed Inbound with UDP support. Telegram behaves similarly.

Image
<!-- gh-comment-id:4789285721 --> @JohniGo76 commented on GitHub (Jun 24, 2026): I previously tried Mixed Inbound with UDP support. Telegram behaves similarly. <img width="796" height="418" alt="Image" src="https://github.com/user-attachments/assets/88dfaf79-a65e-4ac6-8a3c-23513750287c" />
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MHSanaei/3x-ui#3864
No description provided.