第1种方法
1、C语言
wget -N --no-check-certificate https://raw.githubusercontent.com/ToyoDAdoubi/doubi/master/mtproxy.sh && chmod +x mtproxy.sh && bash mtproxy.sh
2、Go语言(推荐)
wget -N --no-check-certificate https://raw.githubusercontent.com/ToyoDAdoubi/doubi/master/mtproxy_go.sh && chmod +x mtproxy_go.sh && bash mtproxy_go.sh
其他操作
启动:/etc/init.d/mtproxy-go start
停止:/etc/init.d/mtproxy-go stop
重启:/etc/init.d/mtproxy-go restart
查看状态:/etc/init.d/mtproxy-go status
安装目录:/usr/local/mtproxy-go
配置文件:/usr/local/mtproxy-go/mtproxy.conf
日志文件:/usr/local/mtproxy-go/mtproxy.log
第2种方法
MTProxy 一键搭建管理脚本
安装
wget -N --no-check-certificate https://raw.githubusercontent.com/FunctionClub/MTProxy-Bash/master/install.sh && bash install.sh
卸载
wget -N --no-check-certificate https://raw.githubusercontent.com/FunctionClub/MTProxy-Bash/master/uninstall.sh && bash uninstall.sh
第3种方法
部署MTPROTO PROXY步骤如下:
1、安装依赖包
debian8/ubuntu14.04:apt-get install php5 php5-xml
debian9/ubuntu16.04 :apt install php php-xml
centos系列:yum install php php-xml
2、下载可执行文件
wget https://phar.madelineproto.xyz/mtproxyd
3、给mtproxyd可执行权限
chmod +x mtproxyd
4、运行,指定一个种子(可随意修改)和端口,例如:
./mtproxyd googlehosts(种子) 2334(端口)
# 这时控制台将输出代理选项中的Secret参数
secret is d65b58732df0f9bf3209d3439987a910
5、如果要保持后台运行可使用nohup 或 screen,例如:
nohup ./mtproxyd googlehosts(种子) 2334(端口) &
screen ./mtproxyd googlehosts(种子) 2334(端口) # 然后 ctrl A, ctrl D
# 杀进程 ps aux | grep mtproxyd
只要你的服务器没有屏蔽Telegram的IP,这时候代理就可以使用了.
tg://proxy?server=(服务器IP,不能用域名)&port=(端口)&secret=(控制台输出的secret)
# 根据自己的情况替换掉,不保留(),即可点击快速设置
转自:如何部署MTPROTO PROXY
第4种方法
Installation
Install NodeJS, NPM, GIT and PM2 on your server:
Debian & Ubuntu
$> apt-get install nodejs npm git
$> npm install pm2 -g
CentsOS & RHEL
$> yum install nodejs npm git
$> npm install pm2 -g
Clone repository on your server:
$> git clone https://github.com/FreedomPrevails/JSMTProxy.git
Enter JSMTProxy directory and edit config file (config.json) if you wish. You can change the secret and listening port. it is in json format.
{
"port":6969,
"secret":"b0cbcef5a486d9636472ac27f8e11a9d"
}
Start the app in cluster mode using pm2:
$> pm2 start mtproxy.js -i max
You can use pm2 to list running processes and check their logs:
$> pm2 list
$> pm2 log #id
项目地址:https://github.com/FreedomPrevails/JSMTProxy安裝nodejs:https://nodejs.org/en/download/package-manager/