tdlib / td

Cross-platform library for building Telegram clients
https://core.telegram.org/tdlib
Boost Software License 1.0
7.1k stars 1.44k forks source link

Unsupported proxy link in tgx #2861

Closed sepehrbrj closed 4 months ago

sepehrbrj commented 6 months ago

20240425_134009.jpg

https://t.me/mehduox_vpn/1700 https://t.me/PewezaVPN/12425

levlam commented 6 months ago

The links are invalid, which can be seen by presence of a lot "A" characters at the end, or "=", or "%" character that must never be used in a valid proxy link secret. You need to find other source of proxy that will not post random garbage.

sepehrbrj commented 6 months ago

The links are invalid, which can be seen by presence of a lot "A" characters at the end, or "=", or "%" character that must never be used in a valid proxy link secret. You need to find other source of proxy that will not post random garbage.

They work fine in official version of telegram

levlam commented 6 months ago

Then this is also a bug of the Android app which incorrectly parse the secret and uses it in some unexpected way.

levlam commented 6 months ago

Likely, you can truncate the secret to 16 bytes to make the link work in Telegram X, but this doesn't make the initial link correct.

sepehrbrj commented 6 months ago

Likely, you can truncate the secret to 16 bytes to make the link work in Telegram X, but this doesn't make the initial link correct.

How can I shorten the link to 16 bytes?

levlam commented 6 months ago

Decode secret part of the link to a binary with base64_decode, then truncate it to 16 bytes, then encode it with base64url_decode. You can do that manually, for example, using https://cryptii.com/pipes/base64-to-hex. The resulting link will be accepted, but given that initial links are invalid there is no any guarantee that resulting link will work.