mtprotoproxy icon indicating copy to clipboard operation
mtprotoproxy copied to clipboard

Mtproto and ad tag problem

Open AINNNNNNDEN opened this issue 1 year ago • 11 comments

My mt proto proxy is working just fine but when I add a Ad Tag to it in config file it just stop working in official versian it keeps flickering connecting and connected Im on Ubuntu 22 Using direct ip for proxy Please advise

AINNNNNNDEN avatar Sep 20 '24 13:09 AINNNNNNDEN

then ad tag enabled, the proxy uses middle proxy. Please check the server has connectivity to servers specified here: https://core.telegram.org/getProxyConfig

I also updated outdated default address of server in the master branch: https://github.com/alexbers/mtprotoproxy/commit/c89479000fb662c48f0ccc514fdd8112d58d87c7 may be it will help

alexbers avatar Sep 20 '24 21:09 alexbers

@alexbers looks like the IPs and ports were changed again. Not only proxies but main IPs too.

aepot avatar Nov 01 '24 19:11 aepot

I've rechecked, they are still working. The main IP's also the same: https://github.com/telegramdesktop/tdesktop/blob/master/Telegram/SourceFiles/mtproto/mtproto_dc_options.cpp#L32

alexbers avatar Nov 11 '24 17:11 alexbers

@alexbers you're right. I've checked another source, the pyrogram lib's docs. Btw, there's no middle proxies with 80 port open anymore in the list by the link you've given above. All the proxies are on 8888.

aepot avatar Nov 11 '24 19:11 aepot

fixed, thanks.

https://github.com/alexbers/mtprotoproxy/commit/bc841cff482a72472f15a36f86ca01aa11cac58b

alexbers avatar Nov 11 '24 20:11 alexbers

Got same problem. I've installed two same copies of proxies on different VPS, first one is working well, but second only works when AD_TAG is empty.

TG_MIDDLE_PROXIES_V4 = { 1: [("149.154.175.50", 8888)], -1: [("149.154.175.50", 8888)], 2: [("149.154.161.144", 80)], -2: [("149.154.161.144", 8888)], 3: [("149.154.175.100", 8888)], -3: [("149.154.175.100", 8888)], 4: [("91.108.4.138", 8888)], -4: [("149.154.165.109", 8888)], 5: [("91.108.56.135", 8888)], -5: [("91.108.56.135", 8888)], }

fromstark avatar Dec 23 '24 09:12 fromstark

I use domain names (FQDN) to do round-robin DNS load balancing of multiple proxies with a single domain name.

Everything works, until I enable the AD_TAG.

I've read somewhere that the proxy submits the detected machine IP address to Telegram servers with AD_TAG. Would it be possible to submit a custom domain instead of the detected IP (like in config.py)? Will that make AD_TAG work for high-availability round-robin setups?

majal avatar May 27 '25 21:05 majal

6-2025 this still happen to me (try different VPSs)

uponatime2019 avatar Jun 18 '25 02:06 uponatime2019

When AD_TAG is enabled, the program tries to connect to Telegram servers via IPv6 — and that's where the problem lies. You need to either disable IPv6 on the host or at the container level.

Update your docker-compose.yml as follows:

🛠 Updated docker-compose.yml services: mtprotoproxy: ... sysctls: - net.ipv6.conf.all.disable_ipv6=1 ports: - "443:443"
Remove the following line if present: network_mode: "host"

And enjoy a working proxy without IPv6 issues!

P.S. Don't forget to update TG_MIDDLE_PROXIES_V4 in the mtprotoproxy.py file with the latest middle proxy IP addresses from Telegram.

Umarchik avatar Jun 19 '25 08:06 Umarchik

I tried everything, but when AD_TAG is not empty, it don't work anymore any solution?

peyman-hakemi avatar Sep 23 '25 15:09 peyman-hakemi

I tried everything, but when AD_TAG is not empty, it don't work anymore any solution?

use original mtproto from telegram, it's most stable

uponatime2019 avatar Sep 24 '25 07:09 uponatime2019