CentOS/RHEL 6.x:
yum -y install epel-release
rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm
CentOS/RHEL 7.x:
yum -y install epel-release
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
yum -y install wget gcc gcc-c++ flex bison make bind bind-libs bind-utils openssl openssl-devel perl quota libaio libcom_err-devel libcurl-devel tar diffutils nano dbus.x86_64 db4-devel cyrus-sasl-devel perl-ExtUtils-Embed.x86_64 cpan vim-common screen libtool perl-core zlib-devel htop git
cd ~
git clone https://github.com/wecanco/MTProxy.git
cd MTProxy
chmod 0755 install.sh
./install.sh
Your binary will be objs/bin/mtproto-proxy
cd ~/MTProxy/objs/bin
curl -s https://core.telegram.org/getProxySecret -o proxy-secret
curl -s https://core.telegram.org/getProxyConfig -o proxy-multi.conf
head -c 16 /dev/urandom | xxd -ps
adduser -M mtproxy
passwd mtproxy
i want run MTProxy on port 444 with my secret key and set promotion channel:
- go to @MTProxybot bot and start it.
- send /newproxy commond.
- send your server ip (or domain/subdomain) and proxy port like ==> host:port
- send secret key generated by head -c 16 /dev/urandom | xxd -ps
- send /myproxies and set promoted channel and get proxy tag key ( like bd66102ce906b987bfc0402764b6543 )
- now you can set proxy tag to your MTProxy to show promotion channel for users.
screen
cd ~/MTProxy/objs/bin && ./mtproto-proxy --user mtproxy --port 8888 --http-ports 444 --mtproto-secret <secret> --proxy-tag <tag> --aes-pwd proxy-secret proxy-multi.conf --slaves 2
or
screen
cd ~/MTProxy/objs/bin && ./mtproto-proxy -u mtproxy -p 8888 -H 444 -S <secret> -P <tag> --aes-pwd proxy-secret proxy-multi.conf -M 2
for limit connections per worker:
screen
cd ~/MTProxy/objs/bin && ./mtproto-proxy --user mtproxy --port 8888 --http-ports 444 --mtproto-secret <secret> --proxy-tag <tag> --aes-pwd proxy-secret proxy-multi.conf --slaves 2 --max-special-connections 10
where:
- mtproxy is the user name. mtproto-proxy calls setuid() to drop privilegies
- 444 is the port, used by clients to connect to the proxy
- 8888 is the local port. You can use it to get statistics from mtproto. Like wget localhost:8888/stats You can only get this stat via loopback
- <secret> is the secret generated by head -c 16 /dev/urandom | xxd -ps
- <tag> is the proxy tag that generated by @MTProxybot
- 2 is the number of workers. You can increase the number of workers, if you have a powerful server
- also feel free to check out other options using
# ~/MTProxy/objs/bin/mtproto-proxy -help
❗ Don't Forget open port 444 on your server firewall
pkill -u mtproxy && pkill screen