TG工具-MTProxy

作者:matrix 发布时间:2018年8月29日 分类:零零星星

MTProxy是专门给Telegram作加密代理的工具,避免平时打开「酸酸乳」之类工具,经常使用TG都订阅了好多消息类的bot,有这样的代理自己搭建更方便打开即用,搭好了之后可以直接点击tg链接即可完成配置。
要搭建此工具需要有一台国外可以正常访问telegram的vps

环境

root@BareInstructive-VM:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 14.04 LTS
Release:    14.04
Codename:   trusty

安装

git clone https://github.com/TelegramMessenger/MTProxy.git
cd MTProxy
make && cd objs/bin
curl -s https://core.telegram.org/getProxySecret -o proxy-secret #获取连接tg的密钥
curl -s https://core.telegram.org/getProxyConfig -o proxy-multi.conf #获取tg服务器ip列表 建议每天定时更新
 head -c 16 /dev/urandom | xxd -ps #使用linux系统创建伪随机数 32长度字符
#生成随机数密钥 31c3f028f2faf77e9ab45d5c209aa02c

开启

./mtproto-proxy -u nobody -p 8888 -H 8181 -S 31c3f028f2faf77e9ab45d5c209aa02c --aes-pwd proxy-secret proxy-multi.conf -M 1

说明:
31c3f028f2faf77e9ab45d5c209aa02c为前面的随机密钥
8888为本地监听的端口 用于查看统计数据: curl localhost:8888/stats
8181为对外提供服务的端口(使用的客户端填写的端口)

图片4050-TG工具-MTProxy

出现main loop就是正常开启

测试

tg中打开链接 OPEN:
https://t.me/proxy?server=tg.hhtjim.com&port=8181&secret=31c3f028f2faf77e9ab45d5c209aa02c

tg://proxy?server=tg.hhtjim.com&port=8181&secret=31c3f028f2faf77e9ab45d5c209aa02c

错误

make编译遇见的问题

  • fatal error: openssl/rand.h: No such file or directory

缺少OpenSSL开发包导致的问题

sudo apt-get install libssl-dev

by:https://linux.cn/article-4147-1.html

  • Makefile:94: recipe for target 'objs/bin/mtproto-proxy' failed
sudo apt-get install zlib1g-dev

by:https://github.com/TelegramMessenger/MTProxy/issues/4

参考:
https://www.jianshu.com/p/d40209b94586
https://github.com/TelegramMessenger/MTProxy
https://liball.me/mtproxy/

一键脚本:https://doub.io/shell-jc7/