---
title: "Telegram Proxy Settings: SOCKS5 and MTProto Setup"
description: "Telegram accepts a SOCKS5 proxy with a username and password natively. Setup on Android, iPhone and desktop, how MTProto differs, and connection fixes."
url: https://proxynet.io/blog/telegram-proxy
date: 2026-09-19
author: "Enver Kaya"
category: "Integration, Tutorial"
lang: en
---

# Telegram Proxy Settings: SOCKS5 and MTProto Setup

You have a proxy in hand: a server address, a port, a username and a password. You want to enter it into Telegram, but the option is not where most people look first. It is not under Privacy and it is not in the phone's network menu; it sits inside **Data and Storage**. Once you find it, you face two choices, SOCKS5 and MTProto. If you do not know which one to pick, it is easy to type the details into the wrong form, and the result is a "Connecting..." label at the top of the screen that never goes away.

This post covers how Telegram uses a proxy, the difference between SOCKS5 and MTProto, the setup steps on Android, iPhone and desktop, what to check when the app is stuck on "Connecting...", and how to turn the proxy off. Menu names are written as they appear in Telegram's official English interface. The setup sections need no code; the single code sample, for bot developers, is in the "advanced" section near the end.

> **Note: Short answer**
>
> The proxy setting lives inside the Telegram app. On a phone, open **Settings > Data and Storage** and tap the proxy row; in Telegram Desktop, open **Settings > Advanced > Connection type**. Choose **SOCKS5** as the type, enter the server, port, username and password exactly as your dashboard shows them, and save. MTProto is a separate proxy type written only for Telegram, and instead of a username it asks for a key called "Secret". If you type SOCKS5 details into the MTProto form, the connection will not come up.

## What does the Telegram proxy setting do?

A proxy is an intermediary server that sits between you and Telegram. Instead of sending your messages straight to Telegram, the app sends them to the proxy first, and the proxy passes them on. Telegram's servers see the proxy's IP address rather than yours. The basics are in our post [What Is a Proxy Server and How Does It Work?](/blog/what-is-a-proxy-server).

Telegram is openly available in most countries, Türkiye included, so most users do not need a proxy at all. A proxy helps in these cases:

- **Corporate, hotel or campus networks.** Some networks only let traffic out through a specific proxy. Until you tell Telegram about that proxy, the app stays on "Connecting...".
- **IP privacy.** If you would rather not have your home or office address be the IP you connect from, you can route the traffic through a proxy you control.
- **Bot and integration development.** You may want a bot on your server to always reach Telegram from the same IP address. We explained the reasoning in [Static IP for API Access](/blog/static-ip-for-api-access).

This setting affects Telegram only; your browser and other apps keep using their own connections. The proxy in the phone's system settings is a separate topic, covered in [Android proxy settings](/blog/android-proxy-settings) and [How to Set iPhone Proxy Settings?](/blog/iphone-proxy). For the difference from a VPN, which encrypts all traffic on the device, see [Proxy vs. VPN: Which One and When?](/blog/proxy-vs-vpn).

## Which proxy types does Telegram support?

According to Telegram's [official proxy documentation](https://core.telegram.org/proxy), the apps support two types: SOCKS5 and MTProto. Some apps offer an extra type; Telegram Desktop, for example, also lists HTTP. The phone apps offer only SOCKS5 and MTProto.

**SOCKS5** is a general-purpose proxy protocol. It can carry traffic for any kind of application, from a browser to a game. The protocol is defined in [RFC 1928](https://datatracker.ietf.org/doc/html/rfc1928), and username and password authentication in [RFC 1929](https://datatracker.ietf.org/doc/html/rfc1929). Telegram supports this authentication directly: the form has two separate fields for username and password. Some applications accept SOCKS5 only without credentials, so this detail makes your life easier. We covered the protocol itself in [What are SOCKS5 Proxies?](/blog/socks5-proxy-101) and how it differs from an HTTP proxy in [SOCKS vs. HTTP Proxy](/blog/socks-vs-http-proxy).

**MTProto proxy** (officially MTProxy) was written for Telegram alone. MTProto is the name of the protocol Telegram apps use to talk to the servers. An MTProto proxy takes that traffic, disguises it so that it is harder to recognise, and forwards it to Telegram. It cannot be used with any other application. Instead of a username and password it asks for a single key called the "secret"; in the interface the field is labelled **Secret**. The server software is open source and lives in [Telegram's GitHub repository](https://github.com/TelegramMessenger/MTProxy).

## What is the difference between SOCKS5 and MTProto?

| Feature | SOCKS5 | MTProto |
|---|---|---|
| Designed for | Traffic from any application | Telegram traffic only |
| Details needed | Server, port; optional username and password | Server, port and the "Secret" key |
| Authentication | Username and password | Secret key only |
| Works in other apps | Yes | No |
| Sponsored channel | None | The proxy operator can pin a channel to your chat list |
| Connection link | `t.me/socks?server=…` | `t.me/proxy?server=…` |
| Where it comes from | Proxy providers, corporate networks | Mostly servers run by volunteers and channels |
| Offered by Proxynet | Yes | No |

To be plain about the last row: Proxynet does not sell MTProto proxies. The [SOCKS5 Proxy](https://proxynet.io/socks5-proxy) we offer goes into Telegram's SOCKS5 form as it is, and the same credentials work in your other applications too.

There is one point that applies to both types. Telegram traffic leaves the app encrypted and reaches the proxy encrypted. Telegram's documentation states that the operator of an MTProto proxy cannot read your messages or identify your account, but can record your IP address because you are connecting to their server. The same encryption applies to traffic sent over SOCKS5. So choosing a proxy is less a question of content privacy and more a question of "who am I showing my IP address to".

## What do you need before you start?

For SOCKS5 you need four pieces of information: the **server address**, the **port**, the **username** and the **password**. They are shown in the dashboard of wherever you got the proxy. Providers often give these four on a single line in the form `server:port:username:password`; in Telegram you type each part into its own field. We explained what these values are in [What Is a Proxy Server Address and How to Find It](/blog/find-proxy-server-address).

Watch two details:

1. **Use the SOCKS5 port.** Some plans give separate ports for HTTP and SOCKS5. Telegram's phone apps do not accept HTTP proxies, so if you enter the HTTP port the connection will not come up.
1. **Choose username and password authentication.** If your proxy works only with an IP whitelist, your IP address changes as soon as the phone switches to mobile data and the proxy no longer recognises you. We compared the two methods in [Proxy Authentication: User:Pass vs IP Whitelist](/blog/proxy-authentication-methods).

In the examples below, the server is `pr.proxynet.io`, the port is `8000`, the username is `user` and the password is `pass`. You will type the values from your own dashboard.

## How do you set up a proxy in Telegram on Android?

1. Open Telegram and go to **Settings**.
1. Tap **Data and Storage**.
1. On that page, open the **Proxy Settings** row.
1. Tap **Add Proxy**.
1. Choose **SOCKS5 Proxy** as the type. The other option is **MTProto Proxy**; if you see a "Secret" field on the screen, you are in the wrong type.
1. Type the address into **Server**, the port into **Port**, and your credentials into **Username** and **Password**.
1. Save. Back on the list, check that the **Use Proxy** switch is on.

Under the proxy you added you will first see "Checking...", then "Available" or "Connected". If it says "Unavailable", Telegram cannot reach that server; move on to the diagnostic list below.

The same screen has a separate switch named **Use Proxy for Calls**. We cover it in the section on calls.

## How do you set up a proxy in Telegram on iPhone?

1. Open Telegram and switch to the **Settings** tab.
1. Go to **Data and Storage**.
1. On that page, tap the **Proxy** row. If no proxy is defined, the row shows "Disabled".
1. Tap **Add Proxy**.
1. Under the **TYPE** heading, choose **SOCKS5**.
1. Fill in **Server** and **Port** under the **CONNECTION** heading.
1. Type the **Username** and **Password** under the **CREDENTIALS (OPTIONAL)** heading.
1. Save, and check that the **Use Proxy** switch is on.

Under the saved proxy you will see "connected" and the ping time in milliseconds. If it says "unavailable", there is a problem with the details or the network. If you copied the proxy details as a `t.me/socks` link, the **Paste From Clipboard** option on the same screen fills in the fields for you.

In the Telegram app for Mac, the setting is also in the **Proxy** section under **Settings > Data and Storage**; the type, server, port, username and password fields carry the same names as on iPhone.

## How do you set up a proxy in Telegram Desktop?

In Telegram Desktop, which runs on Windows, Linux and macOS, the path is a little different:

1. Open **Settings** from the app menu.
1. Go to **Advanced**.
1. Click the **Connection type** row. The "Proxy settings" window opens.
1. Click **Add proxy**.
1. Select **SOCKS5** among the type options. The list also includes HTTP and MTPROTO.
1. Type the server address into **Hostname** and the port into **Port**.
1. Fill in **Username** and **Password** under the **Credentials (optional)** heading.
1. Click **Save**. Check that **Use custom proxy** is selected in the window.

Next to a working proxy you will see "online" or "available" along with a ping value; a proxy that cannot be reached is marked "not available". The same window holds three options: **Disable proxy**, **Use system proxy settings** and **Use custom proxy**. The middle one is specific to Telegram Desktop and makes the app use the system proxy defined in Windows or macOS. On a work computer where the proxy is already defined in the system settings, that option may be all you need.

## One-tap setup with a proxy link

Telegram also accepts proxy details as a link. For SOCKS5 the format is:

`https://t.me/socks?server=pr.proxynet.io&port=8000&user=user&pass=pass`

When you tap this link on a device with Telegram installed, the app shows the details and asks whether you want to add the proxy. MTProto links have the form `t.me/proxy?server=…&port=…&secret=…`.

A link is the quick way to move the details to your second device: send it to yourself through "Saved Messages" and tap it on the other device. Keep in mind that your password is written in the link in plain text. Do not share it in groups or channels; anyone who sees the link can use your proxy.

## Do voice and video calls go through the proxy?

Not by default. The proxy setting covers messages, media and files. Calls have a separate switch, and it ships turned off in all three apps: **Use Proxy for Calls** on Android, **Use for calls** on iPhone, **Use proxy for calls** in Desktop. On Android, this switch is not shown in the list when the active proxy is an MTProto one. Telegram prints its own warning under the switch as well: proxy servers may degrade the quality of your calls.

The reason is the way calls work. According to Telegram's [call documentation](https://core.telegram.org/api/end-to-end/voice-calls), voice packets are sent over UDP; directly to the other party when possible, otherwise to Telegram's relay servers. UDP is a fast transport that sends a packet without waiting to learn whether it arrived. Not every proxy carries UDP, and with those that do, every extra hop adds delay. The details are in the "Proxies and UDP" section of [TCP vs. UDP](/blog/tcp-vs-udp). If your calls work fine, leave this switch off; if the audio breaks up after you turn it on, turn it off again.

## Are free MTProto lists and proxy channels safe?

Search for "Telegram proxy" and you will find free MTProto lists and channels that share new servers every day. We do not provide such a list in this post, because nobody knows who runs those servers.

The operator cannot read your messages, but can record your IP address. When you connect to a server you do not know, you accept the following:

- **You show your IP address and connection times to a stranger.** When and how much you use Telegram sits in that server's logs.
- **A sponsored channel is added to your chat list.** MTProto proxy operators can pin a channel to the top of your list to cover their costs. The channel disappears when you turn the proxy off.
- **Connection quality is unpredictable.** Many people share the same server; it may work one day and be gone the next. The app then stays on "Connecting...".

The same goes for free SOCKS5 lists. We covered the topic in detail in [Are free proxies safe?](/blog/are-free-proxies-safe). If you are going to use Telegram through a proxy, pick a service whose operator you know, with a contract and a support line.

## Which proxy type suits Telegram?

A Telegram session is long-lived: the app stays open all day and talks to the server constantly. That is why an address that stays the same for a long time fits better than a proxy whose address changes often.

- **Single account, personal use or a bot:** a [ISP Proxy](https://proxynet.io/static-isp-residential-proxy) address stays the same for months and is registered to a real internet service provider. If you are going to add your bot's exit address to a firewall, this is the most comfortable option.
- **Work that needs traffic to exit from a mobile carrier address:** a [Mobile Proxy](https://proxynet.io/mobile-proxy) exits through real mobile carrier connections. It suits teams that want to try an application under mobile network conditions.

You can read about the difference between fixed and changing addresses in [Static IP vs. dynamic IP](/blog/static-ip-vs-dynamic-ip). A proxy does not bend Telegram's terms of service. Creating accounts in bulk, sending unsolicited messages or pulling members into groups automatically ends with the account being closed no matter which address it is done from, and it is not the subject of this post.

## What should you do when Telegram is stuck on "Connecting..."?

If the "Connecting..." or "Connecting to proxy" label at the top of the screen disappears while the proxy is on, all is well. If it stays for minutes, work through this list in order:

1. **Turn the proxy off and try.** If the app cannot connect with the proxy off either, the problem is not the proxy but your internet connection or Telegram itself. "Waiting for network..." means the phone cannot get online at all.
1. **Check the type.** The most common mistake is typing SOCKS5 details into the MTProto form. If the form has a "Secret" field, you are in MTProto; delete the proxy and add it again as SOCKS5.
1. **Check the port.** If your dashboard lists separate ports for HTTP and SOCKS5, make sure you typed the SOCKS5 one.
1. **Retype the username and password.** A stray space at the start or end when copying, the phone keyboard capitalising the first letter, and autocorrect are frequent causes.
1. **Look at the authentication method.** If your proxy works with an IP whitelist and the phone moved from Wi-Fi to mobile data, your IP address has changed. Switch to username and password authentication in the dashboard.
1. **Check that the plan is still active.** An expired plan or one that has used up its quota refuses the connection. You can see the status in the dashboard.
1. **Test the proxy outside Telegram.** Try the same details on a computer; we walked through the method in [Is My Proxy Working? How to Test a Proxy](/blog/how-to-test-a-proxy). If it does not work there either, the problem is not Telegram.
1. **See whether the network blocks the port.** Corporate and hotel networks close outbound access to some ports. If the same proxy works on mobile data but not on Wi-Fi, this is the reason; ask the network administrator.

The status text in the proxy list gives you a hint: if a ping value is shown, the server is being reached; if it says "Unavailable", "unavailable" or "not available", Telegram cannot reach that address at all. We collected the other causes of the general "proxy server is not responding" error in [Proxy server not responding](/blog/proxy-server-not-responding).

## How do you turn off the proxy in Telegram?

- **Android:** on the Settings > Data and Storage > Proxy Settings screen, turn off the **Use Proxy** switch. To remove the entry entirely, open the proxy's details and delete it.
- **iPhone:** on the Settings > Data and Storage > Proxy screen, turn off the **Use Proxy** switch.
- **Telegram Desktop:** in the Settings > Advanced > Connection type window, select **Disable proxy**.

If you see a channel labelled "Proxy sponsor" in your chat list, an MTProto proxy is on. When you turn the proxy off, that channel leaves the list too.

## Advanced: using a proxy in a Python bot

This section is for bot developers; readers who only use the app can skip it. Bots do not use the Telegram app but the Bot API at `api.telegram.org`. So the proxy setting in the app has no effect on your bot; you define the proxy in code. Because the Bot API runs over HTTPS, both HTTP and SOCKS5 proxies can be used.

In the `python-telegram-bot` library, the proxy is set with two methods on [ApplicationBuilder](https://docs.python-telegram-bot.org/en/stable/telegram.ext.applicationbuilder.html): `proxy()` covers regular API calls, and `get_updates_proxy()` covers the long-lived connection that waits for updates. SOCKS5 support comes with an extra package: `pip install "python-telegram-bot[socks]"`.

```python
import asyncio
import os
import sys

from telegram.error import InvalidToken, NetworkError
from telegram.ext import ApplicationBuilder

TOKEN = os.environ["BOT_TOKEN"]
PROXY = "socks5://user:pass@pr.proxynet.io:8000"

async def main() -> None:
    app = (
        ApplicationBuilder()
        .token(TOKEN)
        .proxy(PROXY)              # getMe, sendMessage and other calls
        .get_updates_proxy(PROXY)  # the getUpdates (long polling) connection
        .build()
    )
    try:
        async with app:
            me = await app.bot.get_me()
            print("Connection OK:", me.username)
    except InvalidToken:
        print("The proxy works, but the bot token is invalid.")
    except NetworkError as exc:
        print("Could not reach the proxy or Telegram:", exc)
        sys.exit(1)

asyncio.run(main())
```

We ran the code through a local test proxy. With a wrong password the library raises `NetworkError` with the message `httpx.ProxyError: Invalid username/password`, and on a closed port it returns `httpx.ConnectError`. Both belong to the proxy layer; catch them separately from the token error. To use an HTTP proxy, writing the address as `http://user:pass@pr.proxynet.io:8000` is enough, with no extra package. Do not hard-code the token; read it from an environment variable as in the example.

## Common mistakes

- **Looking for the setting in the phone's Wi-Fi menu.** The proxy in the Wi-Fi menu is for web traffic and does not accept SOCKS5. Telegram's phone apps use the proxy defined inside the app.
- **Typing SOCKS5 details into the MTProto form.** The "Secret" field is not a username or password field.
- **Sharing a proxy link that contains a password.** The password is written in plain text in a `t.me/socks` link; anyone who gets the link uses your proxy.
- **Adding one dead free server after another.** Delete the entries you do not use; the longer the list, the harder it is to tell which one is on.
- **Forgetting the proxy is on.** When the plan runs out, Telegram stays on "Connecting..." and the blame falls on Telegram.

## Decision guide

| Your situation | Recommendation |
|---|---|
| You have a proxy with a username and password | Choose the SOCKS5 type and type the four values into their own fields |
| You only have a server, a port and a long key | That is an MTProto proxy; use the form with the "Secret" field and ask who runs it |
| A system proxy is defined on your work computer | Try "Use system proxy settings" in Telegram Desktop |
| Your phone moves between Wi-Fi and mobile data | Use username and password authentication instead of an IP whitelist |
| Your bot must always exit from the same address | Get a proxy with a fixed address and set it with `proxy()` and `get_updates_proxy()` |
| Audio breaks up during calls | Turn off the "Use proxy for calls" switch |
| The "Connecting..." label will not go away | First try with the proxy off, then go through type, port and password in order |

## Frequently asked questions

### What is a Telegram proxy server?

It is an intermediary server that sits between you and Telegram. Telegram supports two types: SOCKS5, which works in any application, and MTProto, which was written only for Telegram. In the app the setting is simply called "Proxy" and sits under Data and Storage.

### What is MTProto?

MTProto is the protocol Telegram apps use to talk to Telegram's servers. An MTProto proxy is special server software written to carry that traffic. Instead of a username and password it works with a single key typed into the "Secret" field, and it cannot be used with other applications.

### Can the proxy provider read my messages?

According to Telegram's official documentation, no: the traffic reaches the proxy encrypted, and the operator cannot read messages or identify your account. What they can see is your IP address, your connection times and the amount of data transferred.

### Does Telegram use the phone's system proxy setting?

The phone apps have no such option; the proxy is defined in the app's own settings. Telegram Desktop does have a "Use system proxy settings" option and can take over the proxy defined in the operating system.

### Can using a proxy get my Telegram account closed?

The proxy setting is a feature the app itself offers; your account will not be closed merely because you use a proxy. What puts accounts at risk is behaviour: unsolicited bulk messages, automated member adding and content that draws complaints. These produce the same outcome whichever IP address they come from.

### Can I use the same proxy on more than one device?

Telegram does not stand in the way; you can enter the same SOCKS5 details on your phone and your computer. The limit is set by your proxy plan: some plans restrict the number of concurrent connections.

## Summary

The proxy setting in Telegram lives inside the app: on a phone under Settings > Data and Storage, in Telegram Desktop on the Settings > Advanced > Connection type row. If you have a proxy with a username and password, the type is SOCKS5; MTProto is a separate, Telegram-only type that works with a "Secret" key, and free lists of unknown origin are worth avoiding. Calls do not go through the proxy by default. When you are stuck on "Connecting...", first try with the proxy off, then check the type, port, password and plan status. For fixed addresses you can enter straight into Telegram's SOCKS5 form, take a look at [our proxy services](/proxy).
