blog icon indicating copy to clipboard operation
blog copied to clipboard

Telegram MTproxy代理搭建完全指南

Open realDuYuanChao opened this issue 6 years ago • 3 comments

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

编译源码

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

ssh [email protected]

更新软件包

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进制端口号

realDuYuanChao avatar Jul 14 '18 09:07 realDuYuanChao

感谢

Skytostop avatar Dec 01 '18 05:12 Skytostop

不用谢

On Sat, Dec 1, 2018 at 1:53 PM Skytostop [email protected] wrote:

感谢

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/shellhub/blog/issues/9#issuecomment-443402389, or mute the thread https://github.com/notifications/unsubscribe-auth/AfEC1xsM_lX-2sENuK7w-j3G7e1TPZDdks5u0hlggaJpZM4VPy8F .

realDuYuanChao avatar Dec 01 '18 05:12 realDuYuanChao

image clean 了好几遍 也不行 怎么树莓派翻墙这么困难。。。。

website19880927 avatar Feb 27 '19 06:02 website19880927