Someone sends you a long string in a chat that starts with t.me/proxy? or tg://proxy? and says "just tap it and it'll work". You tap it, and what happens next is a bit of a lottery. Sometimes Telegram opens straight away, and sometimes a browser opens instead for no obvious reason. Now and then Telegram replies with "The proxy link is invalid.", and you can't tell whether the link is broken or something is wrong with your phone.

Let me be upfront about who's writing this. I own FreeGate, we sell personal proxies, so keep my interest in mind while you read. Still, most pages about proxy links that I came across are lists of addresses, ratings of VPN apps and general glossaries, and hardly anyone takes the link itself apart. So that's what we'll do here, and our part comes at the end.

What's written in that long string

You don't download or install a proxy link, it's not a file and not a program. It hands Telegram a ready-made setting, and it holds exactly three parameters:

t.me/proxy?server=…&port=…&secret=…

The format is described in Telegram's documentation, and all three parameters are marked as required there. The first two are simple: server holds an IP address or a server name, and port holds the port number.

The interesting part is the secret. The funny thing is that it's called a secret, even though there's nothing secret about it: it sits right there in the link for everyone to see. A plain secret is 16 bytes written in hexadecimal, that is 32 characters made of digits and the letters a to f. Often there are two more letters in front of them. If it's dd, the server adds random padding to the packets. If it's ee, the connection is made to look like ordinary HTTPS, and a secret like that gets a tail with a website name. Telegram itself advises server owners to turn on both the padding and this mode.

The ee tail is easier to show with a made-up example than with a real link. Take ee, the 32 characters of the key and the site www.example.com, and you get 64 characters. Everything after the 34th character, namely 7777772e6578616d706c652e636f6d, decodes back to exactly www.example.com. The same secret can also be written in base64, and then it looks like this: 7gARIjNEVWZ3iJmqu8zd7v93d3cuZXhhbXBsZS5jb20, and you can no longer read the site name by eye. Telegram Desktop accepts both forms.

There's no login, no phone number and no access to your account in the link. The sponsored channel that sometimes shows up in your chat list after you connect doesn't come from the link either: the server owner turns it on when registering the proxy with a Telegram bot. There are also t.me/socks?… links for SOCKS5 proxies, and instead of a secret they carry a username and password for the proxy itself, both of them optional.

Why one link opens Telegram and another opens a browser

A link starting with tg://proxy?… is addressed straight to the app. Inside it has the same thing as t.me/proxy?…, and the system passes it to Telegram if Telegram is installed on that device. The Telegram Desktop source code shows that it turns t.me/proxy into tg://proxy by itself, and since version 6.7.4 the links it shares start with tg://. A real link may also have telegram.me or telegram.dog in place of t.me.

With t.me it varies, because it's an ordinary web address and a browser can open it. What you see when you open such a link in a browser depends on the secret. With a short secret you get a Telegram page about MTProxy settings and a button that passes the same three parameters to the app. But with a full ee secret that includes a site name, there's usually no page with a button, and t.me simply redirects you to the telegram.org home page. The page behaves this way on computers and phones alike, and through telegram.me too. So I won't promise you a button in the browser.

Once the link does reach the app, Telegram shows the proxy window. On Android all that's left is to tap "Connect Proxy". Telegram Desktop has the same button, and the window itself is called "Enable proxy".

What if the link won't open?

I'd start with the simplest things:

  1. Was the link copied in full? It should be a single line, from t.me or tg:// to the last character of the secret. Telegram Desktop may reject a link that got cut off or split while being forwarded, and depending on where it was cut, it will say "The proxy link is invalid." or one of the messages from points 3 and 4. Ask for the link again, ideally right in Telegram.
  2. Is Telegram installed on this device? A tg:// link has nothing to open it without the app. If the link took you to a browser and there's no button there, copy it, paste it into any chat in Telegram and tap it there.
  3. Is the app up to date? In such cases Telegram Desktop says: "Your Telegram Desktop version doesn't support this proxy type or the proxy link is invalid. Please update Telegram Desktop to the latest version." Update the app and tap the link again, and if that doesn't help, go back to point 1.
  4. Is the secret correct? Here Telegram Desktop gives a long answer: "This proxy link uses invalid secret parameter. Please contact the proxy provider and ask them to update MTProxy source code and configure it with a correct secret value. Then let them provide a new link." On Android a similar situation looks like this: "The proxy you are using is not configured correctly and will be disabled. Please find another one."

If the link is definitely complete, you can't fix point 4 on your side, because the secret is set by whoever runs the server. You need a new link from the person who gave you this one. And if the proxy connects but messages still don't go through, that's a different story, and the link usually has nothing to do with it.

Why you'd better not forward your own link to anyone

Since the link has no password and no access to your account, it seems safe to share. And your account really will be fine. The proxy owner won't read your messages or see your username, but they can see your IP address and when you connect. Telegram's help says plainly that you should only use proxies from a source you trust, and I've covered how to choose such a source separately.

For the server, the link works like a key: whoever has it can connect. That's why I wouldn't forward a personal link you pay for even to family. Let everyone have their own.

Now, as promised, about FreeGate. We give each device its own link, and it's yours alone. You tap "Connect in Telegram" or scan the QR code, Telegram asks about the proxy, and you tap "Connect Proxy". And if the link does leak, you can change it in your account with one tap, and the old one stops working at once.

The proxy works only inside Telegram, so your banking app and all your other apps go online as usual. You can try it for 1 day free first: sign up with your email, confirm it and connect Telegram, with no payment and no automatic charges. After that it's $1.00 for 30 days or $2.50 for 90 days, price per device, and if you need it on a phone and a computer, you choose 2 when buying. It's all at freegate.app/world, and if some link still won't open for you, you already know which point to start with.