視頻演示傳送門
最近更新了最新版本的ios Telegram后,發(fā)現(xiàn)無法鏈接到服務(wù)器,一直處于Connectting狀態(tài),即使是開啟了ss的全局模式也是沒有任何作用,強(qiáng)制讓Telegram去監(jiān)聽socks5的端口號,試了1080,1086,1087等一些列端口號都無果,最終的解決方案是通過Telegram MTProxy得以解決
編譯源碼
通過SSH鏈接到自己的服務(wù)器
ssh root@140.61.22.18
更新軟件包
yum update -y # For Debian/Ubuntu:
apt update -y # For On CentOS/RHEL:
安裝對應(yīng)的依賴包
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
編譯源代碼生成可以執(zhí)行文件,這里使用make進(jìn)行編譯
make && cd objs/bin
如果編譯失敗,執(zhí)行make clean 清理以下重試
運(yùn)行
獲取用于鏈接Telegram服務(wù)器的secret
curl -s https://core.telegram.org/getProxySecret -o proxy-secret
獲取telegram配置文件
curl -s https://core.telegram.org/getProxyConfig -o proxy-multi.conf
生成一個(gè)32位16進(jìn)制secret用于客服端鏈接
head -c 16 /dev/urandom | xxd -ps
運(yùn)行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>替換為自己的,分別為本地端口號,用于鏈接服務(wù)器的端口,32位16進(jìn)制secret
Telegram客服端鏈接代理
IOS端設(shè)置如下
Setting > Data Storage > Use Proxy > + Add Proxy > MTProto
分別輸入
Server:服務(wù)器ip地址
Port:端口號
Secret:32位16進(jìn)制端口號