New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Telegram MTproxy代理搭建完全指南 #9

Open
shellhub opened this Issue Jul 14, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@shellhub
Owner

shellhub commented Jul 14, 2018

视频演示传送门
最近更新了最新版本的ios Telegram后,发现无法链接到服务器,一直处于Connectting状态,即使是开启了ss的全局模式也是没有任何作用,强制让Telegram去监听socks5的端口号,试了108010861087等一些列端口号都无果,最终的解决方案是通过Telegram MTProxy得以解决

编译源码

通过SSH链接到自己的服务器

ssh root@140.61.22.18

更新软件包

yum update -y # For Debian/Ubuntu:
apt update -y # For On CentOS/RHEL:

安装对应的依赖包
Debian/Ubuntu:

apt install git curl build-essential libssl-dev zlib1g-dev

CentOS/RHEL

yum install openssl-devel zlib-devel
yum groupinstall "Development Tools"

获取MTProxy源代码

git clone https://github.com/TelegramMessenger/MTProxy
cd MTProxy # to source directory

编译源代码生成可以执行文件,这里使用make进行编译

make && cd objs/bin

如果编译失败,执行make clean 清理以下重试

运行

获取用于链接Telegram服务器的secret

curl -s https://core.telegram.org/getProxySecret -o proxy-secret

获取telegram配置文件

curl -s https://core.telegram.org/getProxyConfig -o proxy-multi.conf

生成一个32位16进制secret用于客服端链接

head -c 16 /dev/urandom | xxd -ps

运行mtproto-proxy

chmod +x mtproto-proxy
./mtproto-proxy -u nobody -p 8888 -H 443 -S <secret> --aes-pwd proxy-secret proxy-multi.conf -M 1

注意⚠️
请将-p 8888 -H 443 -S <secret>替换为自己的,分别为本地端口号,用于链接服务器的端口,32位16进制secret

Telegram客服端链接代理

IOS端设置如下
Setting > Data Storage > Use Proxy > + Add Proxy > MTProto
分别输入
Server:服务器ip地址
Port:端口号
Secret:32位16进制端口号

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment