1. 安装Termux终端
2. 安装依赖 执行↓
pkg update -y && pkg install -y python git python-cryptography3. 验证装上了没↓
git --version
python -c "import cryptography; print('ok')"两个都有输出 = 好了
4. 拉官方源码↓
cd ~
git clone https://github.com/Flowseal/tg-ws-proxy
cd ~/tg-ws-proxy
5. 装 certifi ↓python -m pip install certifi
python -c "import certifi; print(certifi.where())"
6. 编一个自己的 secret↓
python -c "import secrets;print(secrets.token_hex(16))"会输出一串 32 位十六进制串 复制留着
7.启动↓
cd ~/tg-ws-proxy
termux-wake-lock
python -m proxy.tg_ws_proxy --secret 替换复制的十六进制串 --log-file ~/tgws.log &
echo $! > ~/tgws.pid8. 等三秒 把链接掏出来 执行↓
sleep 3; grep -o 'tg://proxy[^ ]*' ~/tgws.log输出这样一串链接就是成了:
tg://proxy?server=&port=1443&secret=32位十六进制串
复制到TG点开连接即可
额外:以后删后台需要重启先执行↓
kill $(cat ~/tgws.pid)再执行上面第7步那段
注:所有引用的指令点击即可复制 注意是本地代理 只能在本机使用
ps:这算是比较轻易能创建的代理 一般按照步骤一步一步来都可以创建成功 如果还创建不成功就去问AI吧
——Py分享基地
📮 投稿通道 ☘️ 交流群组