GAKIYUKR's Blog For Web3

GAKIYUKR's Blog For Web3

telegram
github
gitlab
email

Setting up Telegram MTProto Proxy

What is Telegram MTProto Proxy#

TG's self-developed dedicated proxy, characterized by cross-platform compatibility, can be used on any device that can install TG, including but not limited to TV boxes, car machines, and watches. (I use it on my watch myself)

Disadvantages: It has been identified and is more secure than HTTP/Socks5, but it may be blocked every day.

Installation#

For the green version, you need to create a folder to store the files first.

mkdir /home/mtproxy && cd /home/mtproxy
curl -s -o mtproxy.sh https://raw.githubusercontent.com/ellermister/mtproxy/master/mtproxy.sh && chmod +x mtproxy.sh && bash mtproxy.sh

Usage#

Run the service
bash mtproxy.sh start
Debug run
bash mtproxy.sh debug
Stop the service
bash mtproxy.sh stop
Restart the service
bash mtproxy.sh restart

Uninstall#

For the green version, simply delete the folder.

Optimization#

If the proxy you configured needs to be publicly shared or used by a large number of people, it is recommended to modify the configuration to prevent errors.

Edit the file vi /etc/security/limits.conf and add the following content at the end of the file or in the corresponding section to configure the user level:

soft nofile 655350
hard nofile 655350

This means that the soft and hard limits for any user are increased to 655350.

Next, configure at the system level by adding the configuration to vi /etc/sysctl.conf.

fs.file-max = 655350

The maximum number of file descriptors opened by users will not exceed the total number at the system level.

Make the kernel parameters take effect.

sysctl -p
Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.