Skip to content

wecanco/MTProxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Install MTProxy on Centos 6.x & 7.x:

Step 1:

1. Update YUM repositories:

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
2. Install Required Packages
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

Step 2:

1. Download MTProxy and Make it:
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

2. Download MTProxy Config files:
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
3. Now Generate a secret to be used by users to connect to your proxy:
head -c 16 /dev/urandom | xxd -ps
4. Create Proxy User and set password for it:
adduser -M mtproxy
passwd mtproxy

Befor Run mtproto-proxy (Register your proxy and set promotion channel)

i want run MTProxy on port 444 with my secret key and set promotion channel:

  1. go to @MTProxybot bot and start it.
  2. send /newproxy commond.
  3. send your server ip (or domain/subdomain) and proxy port like ==> host:port
  4. send secret key generated by head -c 16 /dev/urandom | xxd -ps
  5. send /myproxies and set promoted channel and get proxy tag key ( like bd66102ce906b987bfc0402764b6543 )
  6. now you can set proxy tag to your MTProxy to show promotion channel for users.

Run mtproto-proxy

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

Stop MTProxy

pkill -u mtproxy && pkill screen

@WeCanGP

About

MTProxy + Monitoring

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages