MTProxy allows users to circumvent internet censorship that restricts Telegram access in certain regions. It does so by masking Telegram's IP and obfuscating user traffic, making it significantly harder for ISPs and governments to detect outgoing connections pointing to Telegram servers.
Any user can connect to an existing MTProxy node, or operate their own.
For maximum security, users who have reasons to expect advanced surveillance should consider layering a trusted VPN on top of the protection MTProxy already provides.
When you connect to an MTProxy node, your fully encrypted Telegram traffic is obfuscated and routed through that node before reaching Telegram’s servers. This allows your traffic to privately reach Telegram even if your internet provider is blocking or attempting to monitor publicly known Telegram-operated IP ranges.
Suppose your city restricts deliveries to a particular foreign address (i.e., Telegram's IP). You could send your package to an out-of-town friend (i.e., MTProxy node) who then forwards it to the original destination. If your friend opens the package, he won't be able to see its content: Telegram encrypts all traffic.
Regardless of encryption, you should pick friends (i.e., proxy servers) you trust – otherwise, they may not deliver your package or log the fact that your address (i.e., your IP) is sending it to Telegram.
Note that this intuitive analogy doesn't cover all MTProxy features – the proxy also employs a number of advanced preventive measures to further obfuscate your traffic, making it harder for an external agent to recognize it belongs to Telegram.
All Telegram mobile and desktop apps allow users to connect via a proxy. To access your proxy settings, follow the respective paths below:
Proxies have specific credentials – like how a website has a URL. In order to connect to it, you will need to know its server, port, and its password or secret. Many proxy managers make their credentials publicly available – you can find them with a Google search or from channels you trust.
Only use proxies from a source you trust, or ask a friend to set one up for you with the guide available below.
Telegram apps generally support two types of proxies – SOCKS5 and MTProto. SOCKS5 proxies only require a server and port to connect, but may have an optional username and password. MTProto proxies always require a server, port and secret. Note that certain apps might also support additional types, like HTTP-proxy.
If you’re already familiar with how proxies operate, you can follow our guide to set up your own proxy instead.
After connecting to an MTProto proxy, you may see an unfamiliar channel in your chat list. This is a channel that is being promoted by the proxy operator, to offset their server costs. Remember that the proxy operator cannot access or see your chat list or Telegram activity in any way.
When you’re connected to a proxy, a shield icon appears at the top of your chat list. You can tap this to directly open your proxy settings.
If you use multiple proxies, you can enable ‘Auto-Switch Proxies’ – this will automatically connect to the next proxy in your list if the current proxy disconnects.
You are free to run your own MTProxy node and make it accessible to other users. To offset your expenses, Telegram allows you to display a promoted channel in the chat list of users that choose to go through your proxy.
You can build MTProxy from source or use a zero-configuration container.
MTProxy is free and open source, its code is available here. Note that you will need a common set of tools for building from source, and development packages for openssl
and zlib
.
Install dependencies
#Debian/Ubuntu
apt install git curl build-essential libssl-dev zlib1g-dev
#CentOS/RHEL
yum install openssl-devel zlib-devel
yum groupinstall "Development Tools"
#Clone the repository and Build
git clone https://github.com/TelegramMessenger/MTProxy
cd MTProxy
make && cd objs/bin
#The final binary will be in objs/bin/mtproto-proxy
Run your instance
#Obtain a secret
curl -s https://core.telegram.org/getProxySecret -o proxy-secret
#Obtain the most recent config
curl -s https://core.telegram.org/getProxyConfig -o proxy-multi.conf
#Generate the secret that will be used by users to connect to your proxy
head -c 16 /dev/urandom | xxd -ps
#Run your instance
chmod +x ./mtproto-proxy
./mtproto-proxy -u nobody -p 8888 -H 443 -S <secret> --aes-pwd proxy-secret proxy-multi.conf -M 1
Each parameter is documented in guide within the repository. You can also use
mtproto-proxy --help
. Consider enabling padding and TLS emulation for maximum security.
Register your instance on Telegram
By registering your proxy on Telegram, you will gain access to usage statistics and monetization. To do so, contact @MTProxyBot on Telegram, type /newproxy
and follow the instructions. Once finished, set the tag you received with arguments: -P <proxy tag>
.
For custom configuration and more advanced instructions, you can check out our detailed guide available here.
Make sure you have properly installed Docker, then simply run:
docker run -d -p443:443 --name=mtproto-proxy --restart=always -v proxy-config:/data telegrammessenger/proxy:latest
Once your MTProxy server is up and running go to @MTProxyBot and register your proxy with Telegram to gain access to usage statistics and monetization.
For custom configuration and more advanced instructions, you can check out our detailed guide available here.
No. An MTProxy node and its operator cannot read your Telegram messages or identify your account – all Telegram traffic is securely encrypted. Note that you should still only connect to nodes you trust, since a malicious operator could collect metadata such as what IP you are connecting from, at what times, and the simple fact that you are trying to use Telegram.
No. An MTProxy node and its operator cannot see your Telegram username or account id. However, note that they can record your IP address, since you are connecting to their server.
Authorities that control your ISP may attempt to tie your IP with your personal identity – if this is a plausible concern for you, consider using a trusted VPN in addition to MTProxy.
Both a proxy and a VPN direct users’ traffic through a separate server. However, proxies typically only reroute the traffic of specific applications (like Telegram) without inherently providing additional encryption – VPNs usually encrypt and reroute all traffic from a user’s device. Note that MTProxy does provide additional obfuscation and anti tracking measures.
Some users opt for a proxy over a VPN for enhanced speed and control as well as reduced costs – proxies often deliver faster connections and can be configured for individual applications. However, if you're already using a trusted VPN service, you can continue to do so.
Not all proxies or VPNs are created equal – make sure to always use trusted providers. Note that a VPN may be more beneficial if you suspect your ISP or government may be performing large-scale surveillance or DPI on your traffic.