How to build telegram proxy
- Lightweight and resource-saving, the mirror image is also small
- Easy to deploy, similar to shadowsocks
- Support FakeTLS mode
- Support ADTag association
- Project address: https://github.com/9seconds/mtg
- Project docker hub address: https://hub.docker.com/r/nineseconds/mtg
- Resistance to replay attacks
- Generate Fake tls form proxy
1. Switch to the root directory
1 | cd /root |
2. Directly download the compiled mtg binary file
1 | wget https://github.com/9seconds/mtg/releases/download/v2.0.1/mtg-2.0.1-linux-amd64.tar.gz //This is the package compiled by the author of 9seconds |
两者的命令主要是参数的不同,解压tar.gz和tar.bz2不同压缩文件的命令如下:
- 解压tar.gz文件
tar -zxvf ×××.tar.gz
- 解压tar.bz2文件
tar -jxvf ×××.tar.bz2
-z :是否同时具有 gzip 的属性?亦即是否需要用 gzip 压缩?
-j :是否同时具有 bzip2 的属性?亦即是否需要用 bzip2 压缩?
Description: The releases address of the package compiled by the author: https://github.com/9seconds/mtg/releases
3. Give root user executable permissions to the binary file
1 | chmod +x /root/mtg |
4. Use the binary file to generate a key to counter-generate an https website
1 | /root/mtg generate-secret -c baidu.com tls |
5. Let the mtg program run in the background with a key monitoring port
1 | nohup /root/mtg run -b 0.0.0.0:12345 ee1e5273b2938f82c3c0eb62b776b0832662616964752e636f6d & |
Explanation:
-b
is followed by the listening address and port, and that large string of characters is the key.cat nohup.out
can view the program running output log, which contains the tg proxy link. For more variable usage, please visit the author’s project address: https://github.com/9seconds/mtg
Second, generate a 32-bit key agent
The first three steps are the same as above
4. Let the mtg program run in the background with a key monitoring port
1 | nohup /root/mtg run -b 0.0.0.0:443 dd28d1eea5fcc3a833f773155f4589a4e3 & |
Note: 443 in the above code is the port number, dd28d1eea5fcc3a833f773155f4589a4e3 is the proxy key (change this key yourself, don’t use this, don’t change the front dd). Someone must say that I am not good at math. It is obviously 34 digits, but it is not.
Adding dd in the front is mandatory security verification. Clients without dd cannot connect. This can better disguise traffic and prevent it from being identified