Coder Social home page Coder Social logo

hirbodbehnam / mtprotoproxyinstaller Goto Github PK

View Code? Open in Web Editor NEW
775.0 22.0 159.0 219 KB

One-click script to install MTProto Proxy server on CentOS, Ubuntu and Debian

License: MIT License

Shell 100.00%
telegram mtproto-proxy installer bash-script mtproxy ubuntu debian centos

mtprotoproxyinstaller's Introduction

MTProto Proxy Auto Installer

A very small script to install MTProtoProxy On Centos or Ubuntu

Why this installer?

  • Generate random secret
  • Scripts for all proxy servers
  • Automatically configure firewall
  • Create a service to run it on background and start up
  • Choose between Official Proxy, Python Proxy and Erlang Proxy
  • Easy to setup
  • Revoke and add secrets after install
  • Supports Centos 7/8 or Ubuntu 18 or later and Debian 10 or later
  • Automatically configure NTP
  • API Support [Reference]

Official Or Python Proxy?

Use python if:

  1. Your server's CPU has one core or you want to run proxy on one core.
  2. Your server is low-end.
  3. You are serving a small group of people. (Like family or small company)
  4. You want to limit user connections.
  5. You also have another application or service running on your server. (Openvpn, shadowsocks, nginx or ...)

Otherwise, use official proxy.

Performance?

Python proxy says it can serve about 4000 concurrent connections with 1 CPU core (~2.5 GHz) and 1024MB RAM.

Official proxy can serve about 10000 to 16000 connections per core.

Python Script

COMPATIBILITY NOTE

Current Python script does not support Centos any more. You can get the latest version which supports it from here.

Install

On your server run

curl -o MTProtoProxyInstall.sh -L https://git.io/fjo34 && bash MTProtoProxyInstall.sh

Wait until the setup finishes, you should be given the links. (using systemctl status mtprotoproxy -l will display said links as well)

To update, uninstall, change port, revoke secret or... the proxy, run this script again.

Managing The Proxy

Service

Use systemctl start mtprotoproxy to start, systemctl stop mtprotoproxy to stop and systemctl status mtprotoproxy -l to see logs of script. For hot reload see below.

Config

To manually config, proxy edit config.py in /opt/mtprotoproxy to change the config; Then restart the server using systemctl restart mtprotoproxy or use hot reload.

Quota Limiter

Python version of the proxy has the ability to limit the users by the traffic they use. You can change the quota by re-running the script after the installation. But remember that if you restart the proxy, all of the usages will reset. (They start counting from 0 again.)

Therefore, if you want user management you can use this program

Hot Reload:

Hot reload reloads the config file without restarting the service. It can be useful if you have set some quota limits.

Copy and execute each of these lines on your terminal:

pid=$(systemctl show --property MainPID mtprotoproxy)
arrPID=(${pid//=/ })
pid=${arrPID[1]}
kill -USR2 "$pid"

API

This script gives you post-install API support to control the proxy. More Info

Official Script

Install

On your server run

curl -o MTProtoProxyOfficialInstall.sh -L https://git.io/fjo3u && bash MTProtoProxyOfficialInstall.sh

and wait until the setup finishes and you will see the links after install.

Workers

Each worker can handle more than 10000 connections on a modern CPU. Connections will be split between workers. Do not spawn workers more than your CPUs thread count.

Auto Install (Keyless)

You can run the script with arguments to enable the "keyless installer".

For example:

curl -o MTProtoProxyOfficialInstall.sh -L https://git.io/fjo3u && bash MTProtoProxyOfficialInstall.sh --port 443 --secret 00000000000000000000000000000000

Reference:

-p | --port : int -> The port that the proxy will listen on it. Do not include this argument to choose a random port
-s | --secret : string -> Adds a secret to list of secrets. Secret must be a 32 characters and in hexadecimal format; Use multiple of this argument to add more secrets (See example below)
-t | --tag : string -> Set the advertisement tag for the proxy. Do not pass this argument to disable the tag.
--workers : int -> The number of workers that the proxy spawns. Default is number of your CPU threads - 1.
--disable-updater : bool -> Pass this argument to disable the proxy updater.
--tls : string -> The host that the proxy must mimic. The default is www.cloudflare.com. To disable the fake tls, use this: '--tls ""'
--custom-args : string -> If you want you can set some other arguments that are directly put into the service file.
--no-bbr : bool -> Pass this argument to do not enable BBR if the operating system is Ubuntu 18.04 or higher. (Does not have any effect on other operating systems).
--no-nat: bool -> Pass this argument to disable the NAT check

Example:

bash MTProtoProxyOfficialInstall.sh --port 443 --secret 00000000000000000000000000000000 --secret 0123456789abcdef0123456789abcdef --tag dcbe8f1493fa4cd9ab300891c0b5b326 --tls "www.google.com"

Managing The Proxy

Service

Use systemctl start MTProxy to start, systemctl stop MTProxy to stop and systemctl status MTProxy -l to see logs of script.

Config

The service file is saved in /etc/systemd/system/MTProxy.service. You can edit it manually. There is also a file named mtconfig.conf at /opt/MTProxy/objs/bin that is created by script. It’s used in loading proxy configs by script. You must not delete this file ,however, you can edit it. Also if you have enabled auto updater, you will have two other files named updater.sh and updater.log

Golang Version Installer (MTG)

This proxy server is written in golang. TBH, I have not worked with it and I have not an idea if it's good or not. Also note that the go version is meant to be easy to setup and does not give you a lot of options to configure your proxy.

Install

curl -o MTGInstall.sh -L https://git.io/mtg_installer && bash MTGInstall.sh

Service

A service name under the name of mtg is created for you. All of the configs are in that service.

Erlang Version Installer

Thanks to @seriyps creator of the Erlang Proxy you can now install the Erlang proxy with a script.

Note: This script works on Ubuntu 18/19 , Debian 9/10 and Centos 7.

curl -L -o mtp_install.sh https://git.io/fj5ru && bash mtp_install.sh

You can also just provide port/secret/ad-tag/protocols as command line arguments:

curl -L -o mtp_install.sh https://git.io/fj5ru && bash mtp_install.sh -p 443 -s d0d6e111bada5511fcce9584deadbeef -t dcbe8f1493fa4cd9ab300891c0b5b326 -a dd -a tls

Other Information

Firewall

Setup will try to configure the proxy on public zone. However you can manually enter these rules in case of any error or whatever. Just rerun the script and choose Generate Firewalld Rules and script will generate and apply firewall rules.

Random Padding

Due to some ISPs detecting MTProxy by packet sizes, random padding is added to packets if such mode is enabled. It's only enabled for clients which request it. Add dd prefix to secret (cafe...babe => ddcafe...babe) to enable this mode on client side.

Fake TLS

Fake TLS is a method that makes the proxy traffic look like TLS (something like websites traffic). In order to make your clients use it you have to share the specific link with them. The script will print it at the end. Fake-TLS links begins with ee.

Quota Managment

I've written a small program in golang(link) to forward traffic with quota managment. I've also written a guide here in order to configure it with MTProto. Right now it also supports the limiting the amount of connections per port. Persian Guide

How to install on Windows?

I've written a small guide to install that on Windows. Please read wiki for more info.

Server

You can use any VPS or Dedicated Server. If you want a cheap and low-end server, I personally recommend to buy one at Virmach; They also accept cryptos!

Persian guide to buying servers, installing script, FAQ and QoS

I DO NOT USE MTPROTO PROXY MYSELF. You can also use shadowsocks with Cloak(Highly Recommended and I use it myself) or wireguard or openvpn instead.

(If you are from Iran, you may need to open this link with VPN)

http://rizy.ir/4EbW

English guide to buying servers and installing script

https://www.reddit.com/r/Telegram/comments/95m5vi/how_to_deploy_mtproto_proxy_server_on_centos/

Proxy Projects

Python Proxy

Official C Proxy

Golang Proxy aka MTG

Erlang Proxy

Donations

You can donate to me through bitcoin at 1XDgEkpnkJ7hC8Kwv5adfaDC1Z3FrkwsK, Ethereum at 0xbb527a28B76235E1C125206B7CcFF944459b4894, ZCash at t1ZKYrYZCjxDYvo6mQaLZi3gNe2a6MydUo3 and Bitcoin Gold at GcNgxfyR3nnAsD3Nhuckvq14sXYuDFkK9P

mtprotoproxyinstaller's People

Contributors

hirbodbehnam avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mtprotoproxyinstaller's Issues

经常掉线,脚本第二个选项更新 又恢复了

Important

  • Please note that I'm not responsible if your server is blocked.
  • If your proxy does not work at all, please try again with a VPN and if it works, do not submit an issue.
  • Remove these lines before opening an issue.

Describe the bug
A clear and concise description of what the bug is.

Server:

  • Server OS:
  • Which script did you used? (Note that you must not open an issue about erlang script here)

FAKE TLS

Hello,
fake tls works on recent android and desktop telegram but does not works on ios!!!! can you help me?

Hang

Hi , when my connection close 1k per hour , my server connection lost and hanging , and i should start again

Python error

Hi.
I receive python error frequently at any part of script.
For example when i want to uninstall i receive:
MTProtoProxyInstall.sh: line 493: python3.6: command not found
I also updated and upgraded all packages.

uvloop Error

After I clicked upgrade, I encountered the following error:

Requirement already satisfied: uvloop in /usr/local/lib/python3.6/dist-packages (0.14.0)
Collecting uvloop
Downloading uvloop-0.15.1.tar.gz (2.1 MB)
|################################| 2.1 MB 70.0 MB/s
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3.6 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-3h928g6k/uvloop_929de4608798456f85f6d60da0bad337/setup.py'"'"'; file='"'"'/tmp/pip-install-3h928g6k/uvloop_929de4608798456f85f6d60da0bad337/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-ef4z4zab
cwd: /tmp/pip-install-3h928g6k/uvloop_929de4608798456f85f6d60da0bad337/
Complete output (5 lines):
Traceback (most recent call last):
File "", line 1, in
File "/tmp/pip-install-3h928g6k/uvloop_929de4608798456f85f6d60da0bad337/setup.py", line 5, in
raise RuntimeError('uvloop requires Python 3.7 or greater')
RuntimeError: uvloop requires Python 3.7 or greater
----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/94/98/9dc814f391b2293ecc790b9752e005296c69c3694fd9975b6cb77c448135/uvloop-0.15.1.tar.gz#sha256=7846828112bfb49abc5fdfc47d0e4dfd7402115c9fde3c14c31818cfbeeb63dc (from https://pypi.org/simple/uvloop/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Using cached uvloop-0.15.0.tar.gz (2.1 MB)
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3.6 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-3h928g6k/uvloop_5b84cbde046444d6b3626b4455c18d74/setup.py'"'"'; file='"'"'/tmp/pip-install-3h928g6k/uvloop_5b84cbde046444d6b3626b4455c18d74/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-gl9swjz5
cwd: /tmp/pip-install-3h928g6k/uvloop_5b84cbde046444d6b3626b4455c18d74/
Complete output (5 lines):
Traceback (most recent call last):
File "", line 1, in
File "/tmp/pip-install-3h928g6k/uvloop_5b84cbde046444d6b3626b4455c18d74/setup.py", line 5, in
raise RuntimeError('uvloop requires Python 3.7 or greater')
RuntimeError: uvloop requires Python 3.7 or greater
----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/df/fb/0e1b479ac5502f3d4531a2fc3f046312616f1ad020c686da353c2ff3bbc6/uvloop-0.15.0.tar.gz#sha256=1a503d5b49da6e3dd5607d6e533a5315b1caedbf629901807c65a23a09cad065 (from https://pypi.org/simple/uvloop/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

Is there any good solution?
Thank you

python proxy not work at all

python proxy does not work on any port and configuration
the official work fine on the same server
it prompts on service following line
python3.8[9580]: Unable to connect to 2001:67c:04e8:f004::a 443
also if i change to python 3.6
os is centos 8.3

فیلتر شدن سریع

سلام دوست عزیز
روی هر دو نسخه تست کردم به سرعت ای پی فیلتر میشه ولی الان پروکسی هست یک ماه داره کار میکنه بدون تعویض ای پی و سرورش برای هتزنر هست به حالت کلی دامنه روی کلود فلیر هست ولی در صورتی که مسنقیم به ای پی وصل بشیم هم باز وصل میشه و بدون مشکل کار میکنه

Compiling on Debian 11 fails.

Server: DigitalOcean server
OS: Debian 11

I ran the ./MTProtoProxyOfficialInstall.sh script. It failed while compiling some files. Can you please help? I can't see the actual error to be able to debug further.

cc  -O3 -std=gnu11 -Wall -mpclmul -march=core2 -mfpmath=sse -mssse3 -fno-strict-aliasing -fno-strict-overflow -fwrapv -DAES=1 -DCOMMIT=\"dc0c7f3de40530053189c572936ae4fd1567269b\" -D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64 -iquote common -iquote . -c -MP -MD -MF dep/mtproto/mtproto-config.d -MQ objs/mtproto/mtproto-config.o -o objs/mtproto/mtproto-config.o mtproto/mtproto-config.c
cc  -O3 -std=gnu11 -Wall -mpclmul -march=core2 -mfpmath=sse -mssse3 -fno-strict-aliasing -fno-strict-overflow -fwrapv -DAES=1 -DCOMMIT=\"dc0c7f3de40530053189c572936ae4fd1567269b\" -D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64 -iquote common -iquote . -c -MP -MD -MF dep/net/net-tcp-rpc-ext-server.d -MQ objs/net/net-tcp-rpc-ext-server.o -o objs/net/net-tcp-rpc-ext-server.o net/net-tcp-rpc-ext-server.c
cc  -O3 -std=gnu11 -Wall -mpclmul -march=core2 -mfpmath=sse -mssse3 -fno-strict-aliasing -fno-strict-overflow -fwrapv -DAES=1 -DCOMMIT=\"dc0c7f3de40530053189c572936ae4fd1567269b\" -D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64 -fpic -iquote common -iquote . -c -MP -MD -MF dep/common/crc32c.d -MQ objs/common/crc32c.o -o objs/common/crc32c.o common/crc32c.c
cc  -O3 -std=gnu11 -Wall -mpclmul -march=core2 -mfpmath=sse -mssse3 -fno-strict-aliasing -fno-strict-overflow -fwrapv -DAES=1 -DCOMMIT=\"dc0c7f3de40530053189c572936ae4fd1567269b\" -D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64 -fpic -iquote common -iquote . -c -MP -MD -MF dep/common/pid.d -MQ objs/common/pid.o -o objs/common/pid.o common/pid.c
cc  -O3 -std=gnu11 -Wall -mpclmul -march=core2 -mfpmath=sse -mssse3 -fno-strict-aliasing -fno-strict-overflow -fwrapv -DAES=1 -DCOMMIT=\"dc0c7f3de40530053189c572936ae4fd1567269b\" -D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64 -fpic -iquote common -iquote . -c -MP -MD -MF dep/common/sha1.d -MQ objs/common/sha1.o -o objs/common/sha1.o common/sha1.c
cc  -O3 -std=gnu11 -Wall -mpclmul -march=core2 -mfpmath=sse -mssse3 -fno-strict-aliasing -fno-strict-overflow -fwrapv -DAES=1 -DCOMMIT=\"dc0c7f3de40530053189c572936ae4fd1567269b\" -D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64 -fpic -iquote common -iquote . -c -MP -MD -MF dep/common/sha256.d -MQ objs/common/sha256.o -o objs/common/sha256.o common/sha256.c
cc  -O3 -std=gnu11 -Wall -mpclmul -march=core2 -mfpmath=sse -mssse3 -fno-strict-aliasing -fno-strict-overflow -fwrapv -DAES=1 -DCOMMIT=\"dc0c7f3de40530053189c572936ae4fd1567269b\" -D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64 -fpic -iquote common -iquote . -c -MP -MD -MF dep/common/md5.d -MQ objs/common/md5.o -o objs/common/md5.o common/md5.c
cc  -O3 -std=gnu11 -Wall -mpclmul -march=core2 -mfpmath=sse -mssse3 -fno-strict-aliasing -fno-strict-overflow -fwrapv -DAES=1 -DCOMMIT=\"dc0c7f3de40530053189c572936ae4fd1567269b\" -D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64 -fpic -iquote common -iquote . -c -MP -MD -MF dep/common/resolver.d -MQ objs/common/resolver.o -o objs/common/resolver.o common/resolver.c
cc  -O3 -std=gnu11 -Wall -mpclmul -march=core2 -mfpmath=sse -mssse3 -fno-strict-aliasing -fno-strict-overflow -fwrapv -DAES=1 -DCOMMIT=\"dc0c7f3de40530053189c572936ae4fd1567269b\" -D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64 -fpic -iquote common -iquote . -c -MP -MD -MF dep/common/parse-config.d -MQ objs/common/parse-config.o -o objs/common/parse-config.o common/parse-config.c
cc  -O3 -std=gnu11 -Wall -mpclmul -march=core2 -mfpmath=sse -mssse3 -fno-strict-aliasing -fno-strict-overflow -fwrapv -DAES=1 -DCOMMIT=\"dc0c7f3de40530053189c572936ae4fd1567269b\" -D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64 -fpic -iquote common -iquote . -c -MP -MD -MF dep/crypto/aesni256.d -MQ objs/crypto/aesni256.o -o objs/crypto/aesni256.o crypto/aesni256.c
cc  -O3 -std=gnu11 -Wall -mpclmul -march=core2 -mfpmath=sse -mssse3 -fno-strict-aliasing -fno-strict-overflow -fwrapv -DAES=1 -DCOMMIT=\"dc0c7f3de40530053189c572936ae4fd1567269b\" -D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64 -fpic -iquote common -iquote . -c -MP -MD -MF dep/jobs/jobs.d -MQ objs/jobs/jobs.o -o objs/jobs/jobs.o jobs/jobs.c
cc  -O3 -std=gnu11 -Wall -mpclmul -march=core2 -mfpmath=sse -mssse3 -fno-strict-aliasing -fno-strict-overflow -fwrapv -DAES=1 -DCOMMIT=\"dc0c7f3de40530053189c572936ae4fd1567269b\" -D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64 -fpic -iquote common -iquote . -c -MP -MD -MF dep/common/mp-queue.d -MQ objs/common/mp-queue.o -o objs/common/mp-queue.o common/mp-queue.c
cc  -O3 -std=gnu11 -Wall -mpclmul -march=core2 -mfpmath=sse -mssse3 -fno-strict-aliasing -fno-strict-overflow -fwrapv -DAES=1 -DCOMMIT=\"dc0c7f3de40530053189c572936ae4fd1567269b\" -D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64 -fpic -iquote common -iquote . -c -MP -MD -MF dep/net/net-events.d -MQ objs/net/net-events.o -o objs/net/net-events.o net/net-events.c
cc  -O3 -std=gnu11 -Wall -mpclmul -march=core2 -mfpmath=sse -mssse3 -fno-strict-aliasing -fno-strict-overflow -fwrapv -DAES=1 -DCOMMIT=\"dc0c7f3de40530053189c572936ae4fd1567269b\" -D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64 -fpic -iquote common -iquote . -c -MP -MD -MF dep/net/net-msg.d -MQ objs/net/net-msg.o -o objs/net/net-msg.o net/net-msg.c
cc  -O3 -std=gnu11 -Wall -mpclmul -march=core2 -mfpmath=sse -mssse3 -fno-strict-aliasing -fno-strict-overflow -fwrapv -DAES=1 -DCOMMIT=\"dc0c7f3de40530053189c572936ae4fd1567269b\" -D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64 -fpic -iquote common -iquote . -c -MP -MD -MF dep/net/net-msg-buffers.d -MQ objs/net/net-msg-buffers.o -o objs/net/net-msg-buffers.o net/net-msg-buffers.c
cc  -O3 -std=gnu11 -Wall -mpclmul -march=core2 -mfpmath=sse -mssse3 -fno-strict-aliasing -fno-strict-overflow -fwrapv -DAES=1 -DCOMMIT=\"dc0c7f3de40530053189c572936ae4fd1567269b\" -D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64 -fpic -iquote common -iquote . -c -MP -MD -MF dep/net/net-config.d -MQ objs/net/net-config.o -o objs/net/net-config.o net/net-config.c
cc  -O3 -std=gnu11 -Wall -mpclmul -march=core2 -mfpmath=sse -mssse3 -fno-strict-aliasing -fno-strict-overflow -fwrapv -DAES=1 -DCOMMIT=\"dc0c7f3de40530053189c572936ae4fd1567269b\" -D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64 -fpic -iquote common -iquote . -c -MP -MD -MF dep/net/net-crypto-aes.d -MQ objs/net/net-crypto-aes.o -o objs/net/net-crypto-aes.o net/net-crypto-aes.c
cc  -O3 -std=gnu11 -Wall -mpclmul -march=core2 -mfpmath=sse -mssse3 -fno-strict-aliasing -fno-strict-overflow -fwrapv -DAES=1 -DCOMMIT=\"dc0c7f3de40530053189c572936ae4fd1567269b\" -D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64 -fpic -iquote common -iquote . -c -MP -MD -MF dep/net/net-crypto-dh.d -MQ objs/net/net-crypto-dh.o -o objs/net/net-crypto-dh.o net/net-crypto-dh.c
cc  -O3 -std=gnu11 -Wall -mpclmul -march=core2 -mfpmath=sse -mssse3 -fno-strict-aliasing -fno-strict-overflow -fwrapv -DAES=1 -DCOMMIT=\"dc0c7f3de40530053189c572936ae4fd1567269b\" -D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64 -fpic -iquote common -iquote . -c -MP -MD -MF dep/net/net-timers.d -MQ objs/net/net-timers.o -o objs/net/net-timers.o net/net-timers.c
cc  -O3 -std=gnu11 -Wall -mpclmul -march=core2 -mfpmath=sse -mssse3 -fno-strict-aliasing -fno-strict-overflow -fwrapv -DAES=1 -DCOMMIT=\"dc0c7f3de40530053189c572936ae4fd1567269b\" -D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64 -fpic -iquote common -iquote . -c -MP -MD -MF dep/net/net-connections.d -MQ objs/net/net-connections.o -o objs/net/net-connections.o net/net-connections.c
cc  -O3 -std=gnu11 -Wall -mpclmul -march=core2 -mfpmath=sse -mssse3 -fno-strict-aliasing -fno-strict-overflow -fwrapv -DAES=1 -DCOMMIT=\"dc0c7f3de40530053189c572936ae4fd1567269b\" -D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64 -fpic -iquote common -iquote . -c -MP -MD -MF dep/net/net-rpc-targets.d -MQ objs/net/net-rpc-targets.o -o objs/net/net-rpc-targets.o net/net-rpc-targets.c
cc  -O3 -std=gnu11 -Wall -mpclmul -march=core2 -mfpmath=sse -mssse3 -fno-strict-aliasing -fno-strict-overflow -fwrapv -DAES=1 -DCOMMIT=\"dc0c7f3de40530053189c572936ae4fd1567269b\" -D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64 -fpic -iquote common -iquote . -c -MP -MD -MF dep/net/net-tcp-connections.d -MQ objs/net/net-tcp-connections.o -o objs/net/net-tcp-connections.o net/net-tcp-connections.c
cc  -O3 -std=gnu11 -Wall -mpclmul -march=core2 -mfpmath=sse -mssse3 -fno-strict-aliasing -fno-strict-overflow -fwrapv -DAES=1 -DCOMMIT=\"dc0c7f3de40530053189c572936ae4fd1567269b\" -D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64 -fpic -iquote common -iquote . -c -MP -MD -MF dep/net/net-tcp-rpc-common.d -MQ objs/net/net-tcp-rpc-common.o -o objs/net/net-tcp-rpc-common.o net/net-tcp-rpc-common.c
cc  -O3 -std=gnu11 -Wall -mpclmul -march=core2 -mfpmath=sse -mssse3 -fno-strict-aliasing -fno-strict-overflow -fwrapv -DAES=1 -DCOMMIT=\"dc0c7f3de40530053189c572936ae4fd1567269b\" -D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64 -fpic -iquote common -iquote . -c -MP -MD -MF dep/net/net-tcp-rpc-client.d -MQ objs/net/net-tcp-rpc-client.o -o objs/net/net-tcp-rpc-client.o net/net-tcp-rpc-client.c
net/net-tcp-rpc-client.c: In function 'tcp_rpcc_init_crypto.part.0':
net/net-tcp-rpc-client.c:634:26: warning: array subscript 0 is outside array bounds of 'union <anonymous>[1]' [-Warray-bounds]
  634 |     dh->dh_params_select = dh_params_select;
      |     ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
net/net-tcp-rpc-client.c:618:5: note: while referencing 'buf'
  618 |   } buf;
      |     ^~~
net/net-tcp-rpc-client.c:638:23: warning: array subscript 0 is outside array bounds of 'union <anonymous>[1]' [-Warray-bounds]
  638 |     dh_first_round (dh->g_a, c->crypto_temp);
      |                     ~~^~~~~
net/net-tcp-rpc-client.c:618:5: note: while referencing 'buf'
  618 |   } buf;
      |     ^~~
cc  -O3 -std=gnu11 -Wall -mpclmul -march=core2 -mfpmath=sse -mssse3 -fno-strict-aliasing -fno-strict-overflow -fwrapv -DAES=1 -DCOMMIT=\"dc0c7f3de40530053189c572936ae4fd1567269b\" -D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64 -fpic -iquote common -iquote . -c -MP -MD -MF dep/net/net-tcp-rpc-server.d -MQ objs/net/net-tcp-rpc-server.o -o objs/net/net-tcp-rpc-server.o net/net-tcp-rpc-server.c
net/net-tcp-rpc-server.c: In function 'tcp_rpcs_init_crypto':
net/net-tcp-rpc-server.c:602:51: warning: array subscript 0 is outside array bounds of 'union <anonymous>[1]' [-Warray-bounds]
  602 |     temp_dh_len = dh_second_round (temp_dh, new_dh->g_a, old_dh->g_a);
      |                                             ~~~~~~^~~~~
net/net-tcp-rpc-server.c:582:5: note: while referencing 'buf'
  582 |   } buf;
      |     ^~~
cc  -O3 -std=gnu11 -Wall -mpclmul -march=core2 -mfpmath=sse -mssse3 -fno-strict-aliasing -fno-strict-overflow -fwrapv -DAES=1 -DCOMMIT=\"dc0c7f3de40530053189c572936ae4fd1567269b\" -D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64 -fpic -iquote common -iquote . -c -MP -MD -MF dep/net/net-http-server.d -MQ objs/net/net-http-server.o -o objs/net/net-http-server.o net/net-http-server.c
cc  -O3 -std=gnu11 -Wall -mpclmul -march=core2 -mfpmath=sse -mssse3 -fno-strict-aliasing -fno-strict-overflow -fwrapv -DAES=1 -DCOMMIT=\"dc0c7f3de40530053189c572936ae4fd1567269b\" -D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64 -fpic -iquote common -iquote . -c -MP -MD -MF dep/common/tl-parse.d -MQ objs/common/tl-parse.o -o objs/common/tl-parse.o common/tl-parse.c
cc  -O3 -std=gnu11 -Wall -mpclmul -march=core2 -mfpmath=sse -mssse3 -fno-strict-aliasing -fno-strict-overflow -fwrapv -DAES=1 -DCOMMIT=\"dc0c7f3de40530053189c572936ae4fd1567269b\" -D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64 -fpic -iquote common -iquote . -c -MP -MD -MF dep/common/common-stats.d -MQ objs/common/common-stats.o -o objs/common/common-stats.o common/common-stats.c
cc  -O3 -std=gnu11 -Wall -mpclmul -march=core2 -mfpmath=sse -mssse3 -fno-strict-aliasing -fno-strict-overflow -fwrapv -DAES=1 -DCOMMIT=\"dc0c7f3de40530053189c572936ae4fd1567269b\" -D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64 -fpic -iquote common -iquote . -c -MP -MD -MF dep/engine/engine.d -MQ objs/engine/engine.o -o objs/engine/engine.o engine/engine.c
cc  -O3 -std=gnu11 -Wall -mpclmul -march=core2 -mfpmath=sse -mssse3 -fno-strict-aliasing -fno-strict-overflow -fwrapv -DAES=1 -DCOMMIT=\"dc0c7f3de40530053189c572936ae4fd1567269b\" -D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64 -fpic -iquote common -iquote . -c -MP -MD -MF dep/engine/engine-signals.d -MQ objs/engine/engine-signals.o -o objs/engine/engine-signals.o engine/engine-signals.c
cc  -O3 -std=gnu11 -Wall -mpclmul -march=core2 -mfpmath=sse -mssse3 -fno-strict-aliasing -fno-strict-overflow -fwrapv -DAES=1 -DCOMMIT=\"dc0c7f3de40530053189c572936ae4fd1567269b\" -D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64 -fpic -iquote common -iquote . -c -MP -MD -MF dep/engine/engine-net.d -MQ objs/engine/engine-net.o -o objs/engine/engine-net.o engine/engine-net.c
cc  -O3 -std=gnu11 -Wall -mpclmul -march=core2 -mfpmath=sse -mssse3 -fno-strict-aliasing -fno-strict-overflow -fwrapv -DAES=1 -DCOMMIT=\"dc0c7f3de40530053189c572936ae4fd1567269b\" -D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64 -fpic -iquote common -iquote . -c -MP -MD -MF dep/engine/engine-rpc.d -MQ objs/engine/engine-rpc.o -o objs/engine/engine-rpc.o engine/engine-rpc.c
cc  -O3 -std=gnu11 -Wall -mpclmul -march=core2 -mfpmath=sse -mssse3 -fno-strict-aliasing -fno-strict-overflow -fwrapv -DAES=1 -DCOMMIT=\"dc0c7f3de40530053189c572936ae4fd1567269b\" -D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64 -fpic -iquote common -iquote . -c -MP -MD -MF dep/engine/engine-rpc-common.d -MQ objs/engine/engine-rpc-common.o -o objs/engine/engine-rpc-common.o engine/engine-rpc-common.c
cc  -O3 -std=gnu11 -Wall -mpclmul -march=core2 -mfpmath=sse -mssse3 -fno-strict-aliasing -fno-strict-overflow -fwrapv -DAES=1 -DCOMMIT=\"dc0c7f3de40530053189c572936ae4fd1567269b\" -D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64 -fpic -iquote common -iquote . -c -MP -MD -MF dep/net/net-thread.d -MQ objs/net/net-thread.o -o objs/net/net-thread.o net/net-thread.c
cc  -O3 -std=gnu11 -Wall -mpclmul -march=core2 -mfpmath=sse -mssse3 -fno-strict-aliasing -fno-strict-overflow -fwrapv -DAES=1 -DCOMMIT=\"dc0c7f3de40530053189c572936ae4fd1567269b\" -D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64 -fpic -iquote common -iquote . -c -MP -MD -MF dep/net/net-stats.d -MQ objs/net/net-stats.o -o objs/net/net-stats.o net/net-stats.c
cc  -O3 -std=gnu11 -Wall -mpclmul -march=core2 -mfpmath=sse -mssse3 -fno-strict-aliasing -fno-strict-overflow -fwrapv -DAES=1 -DCOMMIT=\"dc0c7f3de40530053189c572936ae4fd1567269b\" -D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64 -fpic -iquote common -iquote . -c -MP -MD -MF dep/common/proc-stat.d -MQ objs/common/proc-stat.o -o objs/common/proc-stat.o common/proc-stat.c
cc  -O3 -std=gnu11 -Wall -mpclmul -march=core2 -mfpmath=sse -mssse3 -fno-strict-aliasing -fno-strict-overflow -fwrapv -DAES=1 -DCOMMIT=\"dc0c7f3de40530053189c572936ae4fd1567269b\" -D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64 -fpic -iquote common -iquote . -c -MP -MD -MF dep/common/kprintf.d -MQ objs/common/kprintf.o -o objs/common/kprintf.o common/kprintf.c
cc  -O3 -std=gnu11 -Wall -mpclmul -march=core2 -mfpmath=sse -mssse3 -fno-strict-aliasing -fno-strict-overflow -fwrapv -DAES=1 -DCOMMIT=\"dc0c7f3de40530053189c572936ae4fd1567269b\" -D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64 -fpic -iquote common -iquote . -c -MP -MD -MF dep/common/precise-time.d -MQ objs/common/precise-time.o -o objs/common/precise-time.o common/precise-time.c
cc  -O3 -std=gnu11 -Wall -mpclmul -march=core2 -mfpmath=sse -mssse3 -fno-strict-aliasing -fno-strict-overflow -fwrapv -DAES=1 -DCOMMIT=\"dc0c7f3de40530053189c572936ae4fd1567269b\" -D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64 -fpic -iquote common -iquote . -c -MP -MD -MF dep/common/cpuid.d -MQ objs/common/cpuid.o -o objs/common/cpuid.o common/cpuid.c
cc  -O3 -std=gnu11 -Wall -mpclmul -march=core2 -mfpmath=sse -mssse3 -fno-strict-aliasing -fno-strict-overflow -fwrapv -DAES=1 -DCOMMIT=\"dc0c7f3de40530053189c572936ae4fd1567269b\" -D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64 -fpic -iquote common -iquote . -c -MP -MD -MF dep/common/server-functions.d -MQ objs/common/server-functions.o -o objs/common/server-functions.o common/server-functions.c
cc  -O3 -std=gnu11 -Wall -mpclmul -march=core2 -mfpmath=sse -mssse3 -fno-strict-aliasing -fno-strict-overflow -fwrapv -DAES=1 -DCOMMIT=\"dc0c7f3de40530053189c572936ae4fd1567269b\" -D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64 -fpic -iquote common -iquote . -c -MP -MD -MF dep/common/crc32.d -MQ objs/common/crc32.o -o objs/common/crc32.o common/crc32.c
rm -f objs/lib/libkdb.a && ar rcs objs/lib/libkdb.a objs/common/crc32c.o objs/common/pid.o objs/common/sha1.o objs/common/sha256.o objs/common/md5.o objs/common/resolver.o objs/common/parse-config.o objs/crypto/aesni256.o objs/jobs/jobs.o objs/common/mp-queue.o objs/net/net-events.o objs/net/net-msg.o objs/net/net-msg-buffers.o objs/net/net-config.o objs/net/net-crypto-aes.o objs/net/net-crypto-dh.o objs/net/net-timers.o objs/net/net-connections.o objs/net/net-rpc-targets.o objs/net/net-tcp-connections.o objs/net/net-tcp-rpc-common.o objs/net/net-tcp-rpc-client.o objs/net/net-tcp-rpc-server.o objs/net/net-http-server.o objs/common/tl-parse.o objs/common/common-stats.o objs/engine/engine.o objs/engine/engine-signals.o objs/engine/engine-net.o objs/engine/engine-rpc.o objs/engine/engine-rpc-common.o objs/net/net-thread.o objs/net/net-stats.o objs/common/proc-stat.o objs/common/kprintf.o objs/common/precise-time.o objs/common/cpuid.o objs/common/server-functions.o objs/common/crc32.o
cc -o objs/bin/mtproto-proxy objs/mtproto/mtproto-proxy.o objs/mtproto/mtproto-config.o objs/net/net-tcp-rpc-ext-server.o objs/lib/libkdb.a objs/lib/libkdb.a  -ggdb -rdynamic -lm -lrt -lcrypto -lz -lpthread -lcrypto
/usr/bin/ld: objs/mtproto/mtproto-config.o:(.bss+0x200a0): multiple definition of `kdb_hosts_loaded'; objs/mtproto/mtproto-proxy.o:(.bss+0x4f01b48): first defined here
/usr/bin/ld: objs/net/net-tcp-rpc-ext-server.o:(.bss+0x0): multiple definition of `kdb_hosts_loaded'; objs/mtproto/mtproto-proxy.o:(.bss+0x4f01b48): first defined here
/usr/bin/ld: objs/lib/libkdb.a(resolver.o):(.bss+0x0): multiple definition of `kdb_hosts_loaded'; objs/mtproto/mtproto-proxy.o:(.bss+0x4f01b48): first defined here
/usr/bin/ld: objs/lib/libkdb.a(parse-config.o):(.bss+0x28): multiple definition of `kdb_hosts_loaded'; objs/mtproto/mtproto-proxy.o:(.bss+0x4f01b48): first defined here
/usr/bin/ld: objs/lib/libkdb.a(net-rpc-targets.o):(.bss+0x820): multiple definition of `total_vv_tree_nodes'; objs/lib/libkdb.a(net-connections.o):(.bss+0xc34a8): first defined here
/usr/bin/ld: objs/lib/libkdb.a(net-http-server.o):(.bss+0x18): multiple definition of `http_queries'; objs/mtproto/mtproto-proxy.o:(.bss+0x488): first defined here
/usr/bin/ld: objs/lib/libkdb.a(engine-rpc.o):(.bss+0x0): multiple definition of `total_vv_tree_nodes'; objs/lib/libkdb.a(net-connections.o):(.bss+0xc34a8): first defined here
/usr/bin/ld: objs/lib/libkdb.a(net-stats.o):(.bss+0x8): multiple definition of `total_vv_tree_nodes'; objs/lib/libkdb.a(net-connections.o):(.bss+0xc34a8): first defined here
/usr/bin/ld: objs/lib/libkdb.a(pid.o):(.bss+0x0): multiple definition of `PID'; objs/lib/libkdb.a(net-stats.o):(.bss+0x30): first defined here
collect2: error: ld returned 1 exit status
make: *** [Makefile:94: objs/bin/mtproto-proxy] Error 1
Error: Build failed with exit code 2
Deleting the project files...
Done```

With Openvpn on same server

Good day!
I have an issue and I don't know how to solve it. Tried Googling but I didn't find any solution (may be I am blind).
Info:

  1. Telegram Proxy and Openvpn server are living on the same server (same ip).
  2. I am using Openvpn on my router. Default route - everything through VPN.

Issue:
When I am connected to my home network (VPN), I am not able to reach my Telegram proxy through global ip address, I can reach it only through Openvpn's internal network (e.g. 10.3.0.1).

Question:
What iptables rule I have to input on my server, so I will be able to communicate with telegram proxy whem I am in my home network (VPN)? Or I have to setup port-forwarding on router?

My iptables rules:

*nat
:PREROUTING ACCEPT [0:0]
:INPUT ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A POSTROUTING -s 10.3.0.0/24 -o eth0 -j MASQUERADE
COMMIT
# Completed on Sat May  2 13:17:09 2020
# Generated by xtables-save v1.8.2 on Sat May  2 13:17:09 2020
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -i eth0 -p udp -m udp --dport 53210 -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -i tun0 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 443 -j ACCEPT
-A FORWARD -i tun0 -o eth0 -j ACCEPT
-A FORWARD -i eth0 -o tun0 -j ACCEPT
COMMIT

Different address from Bot vs Script

hi

I run script well and i receive my address.
so when I try this address everything is well and I can connect to server without any problem.

but when I use @MTProxybot for create AD Tag, it will response to me like this:

Success!
Your proxy has been successfully registered. You can now pass this proxy tag to the software you are using: XXXXXXXXXXX.
Here is a link to your proxy server: https://t.me/proxy?server=XXX.XXX.XXX.XXX&port=443&secret=XXXXXXXX
And here is a direct link for those who have the Telegram app installed: tg://proxy?server= XXX.XXX.XXX.XXX&port=443&secret= XXXXXXXX

when I try to connect to my proxy with bot link, it can not connect and say: Unavailable

so my questions is:

  • why this two address is different
  • why bot link does not work
  • sponsor proxy will work in which address?

after 24 hours, telegram does not show my sponsor channel, so I think there is a problem in these urls

delete expire date isue

there is a bug on expiry date function
after add expire date.if want to remove expire date and enter nothing .return message as invalid date format.

Unable to connect

Hi,

I encountered a new problem, the error message is as follows:

Feb 20 17:24:37 ubuntu python3.8[4164]: Unable to connect to 2001:b28:f23f:f005::a 443
Feb 20 17:24:37 ubuntu python3.8[4164]: Unable to connect to 2001:b28:f23f:f005::a 443
Feb 20 17:24:37 ubuntu python3.8[4164]: Unable to connect to 2001:b28:f23f:f005::a 443
Feb 20 17:24:38 ubuntu python3.8[4164]: Unable to connect to 2001:b28:f23f:f005::a 443
Feb 20 17:24:38 ubuntu python3.8[4164]: Unable to connect to 2001:b28:f23f:f005::a 443
Feb 20 17:24:38 ubuntu python3.8[4164]: Unable to connect to 2001:b28:f23f:f005::a 443
Feb 20 17:24:38 ubuntu python3.8[4164]: Unable to connect to 2001:b28:f23f:f005::a 443
Feb 20 17:24:40 ubuntu python3.8[4164]: Unable to connect to 2001:b28:f23f:f005::a 443
Feb 20 17:24:40 ubuntu python3.8[4164]: Unable to connect to 2001:b28:f23f:f005::a 443
Feb 20 17:24:40 ubuntu python3.8[4164]: Unable to connect to 2001:b28:f23f:f005::a 443

In the latest version, it seems that IPv6 is used for linking by default, causing mtproto to fail to link normally.
Is there a solution to this problem?

Thank you.

[FEATURE] Allow User to Specify Custom Server IP

Hello, 👋

First, thanks for the script! It's really helpful for setting up a Telegram Proxy server 😄

I have a feature suggestion: It would be nice to allow user to specify the IP address on their own, for the proxy server address.

It will be useful for:

  • Server that has multiple IPs
  • Server behind NAT, with port forwarding allowed but to different IPs than server's IP -> My current case

I will try to implement this by adding question about IP address in the script. If succeed, I will submit a PR.

Thanks! 😁

Could not connect from client

Hello and thank you for your work.

  • I have run the script and I have a question what is the username good for?
  • What is the AD_TAG good for?

And when I create a user and a key when I want to connect to it from the client it sees the mtproto server
but it cannot connect to it. it switches between connecting and online.
Is there any log which I could look at to see which see what is the problem is?

image

image

Revoking a user does not delete expiry date and connection limits

I encountered a really small issue that if you remove a user (revoke a secret), the expiry date and the connection limit will not be deleted.
This is not a critical problem with the script however it should be fixed.

Also it would be really cool to refactor the connection limits file to use json instead of a custom file.

How many connection needed for each user

in simultaneous connection limit, how many connections is needed for each telegram instance? 1 or more? is an app run better with more connections or they are not used?

آیا این ضد فیلتره؟

Important

  • Please note that I'm not responsible if your server is blocked.
  • If your proxy does not work at all, please try again with a VPN and if it works, do not submit an issue.
  • Remove these lines before opening an issue.

Describe the bug
A clear and concise description of what the bug is.

Server:

  • Server OS:
  • Which script did you used? (Note that you must not open an issue about erlang script here)

request

Added view of the amount of traffic consumed by each proxy.

thanks.

Change Expriy Date

When we want to delete a predefined expiration date for a proxy, it is not possible, that is, we leave it blank and press enter, but it gives an error.

Overwriting Other config.py Options

When changing a setting with script any other options rather than PORT, SECRET, AD_TAG and SECURE_ONLY will be removed. This is because script regenerates a new file.
For example TO_CLT_BUFSIZE will be removed after you change port with script.

install

سلام

و آیا بهتر نیست کد های زیر را در ابتدا و قبل شروع نصب برای سنتوس 7 قرار دهید،چون در بعضی سرورها نصب و فعال نمی باشد

if [ ${OS} == CentOS ];then
yum install firewalld -y
systemctl enable firewalld
systemctl start firewalld
systemctl status firewalld
fi

add support of more core run of python proxy

as simplicity of python proxy and the possibility of running multiple instances of proxy to use more CPU core, it is good to add multiple instances running of python proxy to the script

random padding vs fake tls

random padding vs fake tls
which one is better? more secure? more difficult to detect?
is it possible to use both of them? is it have any benefit?

I can't connect SSH to my Azure VM after setup a MTProto Proxy

I install MTProto Proxy using Python script method.
After that the proxy worked perfectly. "systemctl status mtprotoproxy" is active and running.
The problem is when I closed my SSH session and connect it again, terminal on local computer said that "ssh: connect to host port 22: Connection timed out"

I used the script to install and it gave an error at the end, server is ARM64

Erro in install

Setting up libstdc++-9-dev:arm64 (9.3.0-17ubuntu1~20.04) ...
Setting up gcc (4:9.3.0-1ubuntu2) ...
Setting up g++-9 (9.3.0-17ubuntu1~20.04) ...
Setting up g++ (4:9.3.0-1ubuntu2) ...
update-alternatives: using /usr/bin/g++ to provide /usr/bin/c++ (c++) in auto mode
Setting up build-essential (12.8ubuntu1.1) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for libc-bin (2.31-0ubuntu9.2) ...
Cloning into 'MTProxy'...
remote: Enumerating objects: 318, done.
remote: Total 318 (delta 0), reused 0 (delta 0), pack-reused 318
Receiving objects: 100% (318/318), 331.29 KiB | 20.71 MiB/s, done.
Resolving deltas: 100% (180/180), done.
cc  -O3 -std=gnu11 -Wall -mpclmul -march=core2 -mfpmath=sse -mssse3 -fno-strict-aliasing -fno-strict-overflow -fwrapv -DAES=1 -DCOMMIT=\"ad4d2af27d96f5f27855b8b2b176306675f8a4c2\" -D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64 -iquote common -iquote . -c -MP -MD -MF dep/mtproto/mtproto-proxy.d -MQ objs/mtproto/mtproto-proxy.o -o objs/mtproto/mtproto-proxy.o mtproto/mtproto-proxy.c
cc: error: unrecognized command line option ‘-mpclmul’
cc: error: unrecognized command line option ‘-mfpmath=sse’
cc: error: unrecognized command line option ‘-mssse3’
make: *** [Makefile:86: objs/mtproto/mtproto-proxy.o] Error 1
Error: Build failed with exit code 2
Deleting the project files...
Done

Backup Possibility

I am running python server
How can backup server and client settings and transfer it to another server? is it possible?

ModuleNotFoundError

Hi, installing finishes without any exceptions, but my clients are unable to connect.
Describe the bug
Here are logs from systemctl status mtprotoproxy -l

     Loaded: loaded (/etc/systemd/system/mtprotoproxy.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Sun 2020-09-27 15:26:18 CEST; 42s ago
    Process: 19416 ExecStart=/usr/bin/python3.6 /opt/mtprotoproxy/mtprotoproxy.py (code=exited, status=1/FAILURE)
   Main PID: 19416 (code=exited, status=1/FAILURE)

Sep 27 15:26:18 qqw python3.6[19416]:     from cryptography.x509.base import (
Sep 27 15:26:18 qqw python3.6[19416]:   File "/usr/lib/python3/dist-packages/cryptography/x509/base.py", line 18, in <module>
Sep 27 15:26:18 qqw python3.6[19416]:     from cryptography.x509.extensions import Extension, ExtensionType
Sep 27 15:26:18 qqw python3.6[19416]:   File "/usr/lib/python3/dist-packages/cryptography/x509/extensions.py", line 20, in <module>
Sep 27 15:26:18 qqw python3.6[19416]:     from cryptography.hazmat.primitives import constant_time, serialization
Sep 27 15:26:18 qqw python3.6[19416]:   File "/usr/lib/python3/dist-packages/cryptography/hazmat/primitives/constant_time.py", line 1>
Sep 27 15:26:18 qqw python3.6[19416]:     from cryptography.hazmat.bindings._constant_time import lib
Sep 27 15:26:18 qqw python3.6[19416]: ModuleNotFoundError: No module named '_cffi_backend'
Sep 27 15:26:18 qqw systemd[1]: mtprotoproxy.service: Main process exited, code=exited, status=1/FAILURE
Sep 27 15:26:18 qqw systemd[1]: mtprotoproxy.service: Failed with result 'exit-code'.
...skipping...
● mtprotoproxy.service - MTProto Proxy Service
     Loaded: loaded (/etc/systemd/system/mtprotoproxy.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Sun 2020-09-27 15:26:18 CEST; 42s ago
    Process: 19416 ExecStart=/usr/bin/python3.6 /opt/mtprotoproxy/mtprotoproxy.py (code=exited, status=1/FAILURE)
   Main PID: 19416 (code=exited, status=1/FAILURE)

Sep 27 15:26:18 qqw python3.6[19416]:     from cryptography.x509.base import (
Sep 27 15:26:18 qqw python3.6[19416]:   File "/usr/lib/python3/dist-packages/cryptography/x509/base.py", line 18, in <module>
Sep 27 15:26:18 qqw python3.6[19416]:     from cryptography.x509.extensions import Extension, ExtensionType
Sep 27 15:26:18 qqw python3.6[19416]:   File "/usr/lib/python3/dist-packages/cryptography/x509/extensions.py", line 20, in <module>
Sep 27 15:26:18 qqw python3.6[19416]:     from cryptography.hazmat.primitives import constant_time, serialization
Sep 27 15:26:18 qqw python3.6[19416]:   File "/usr/lib/python3/dist-packages/cryptography/hazmat/primitives/constant_time.py", line 1>
Sep 27 15:26:18 qqw python3.6[19416]:     from cryptography.hazmat.bindings._constant_time import lib
Sep 27 15:26:18 qqw python3.6[19416]: ModuleNotFoundError: No module named '_cffi_backend'
Sep 27 15:26:18 qqw systemd[1]: mtprotoproxy.service: Main process exited, code=exited, status=1/FAILURE
Sep 27 15:26:18 qqw systemd[1]: mtprotoproxy.service: Failed with result 'exit-code'.

Server:

  • Server OS: Ubuntu 20.04
  • Which script did you used? - Python script

cant connect

Hi,
I use your solution for create my mtproto server
every things are good in installation, but i cant connect to it (from iran).
my server's ip is not blocked but i just connect to it with vpn.

can you help me to solve this problem?

MTProtoProxyInstall.sh: line 290: hexdump: command not found

-Ubuntu SMP Thu Jan 14 09:19:02 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Do you want to set secret manually or shall I create a random secret?

  1. Manually enter a secret
  2. Create a random secret
    Please select one [1-2]: 2
    MTProtoProxyInstall.sh: line 290: hexdump: command not found

Some clients are unable to connect

@HirbodBehnam

Hi,
I've noticed some random clients are unable to connect to the server i've started recently, While some other clients have no problems connecting to it.
I'm attaching my config file contents and the log from systemctl here to see if you can resolve the problem.
Config file:

PORT = 443
USER_MAX_TCP_CONNS = {  }
TLS_DOMAIN = "www.cloudflare.com"
MODES = { "classic": True, "secure": True, "tls": True }
USERS = {"mt1": "da911d79f646bfcfd4d64ac2f079e55e"}

systemctl log:

● mtprotoproxy.service - MTProto Proxy Service
   Loaded: loaded (/etc/systemd/system/mtprotoproxy.service; enabled; vendor preset: disabled)
   Active: active (running) since Fri 2020-01-17 07:38:53 EST; 10s ago
 Main PID: 1855 (python3.6)
   CGroup: /system.slice/mtprotoproxy.service
           └─1855 /usr/bin/python3.6 /opt/mtprotoproxy/mtprotoproxy.py

Jan 17 07:38:53 server.domain.com systemd[1]: Started MTProto Proxy Service.
Jan 17 07:38:53 server.domain.com python3.6[1855]: mt1: tg://proxy?server=x.x.x.x&port=443&secret=eeda911d79f646bfcfd4d64ac2f079e55e7777772e636c6f7564666c6172652e636f6d
Jan 17 07:38:53 server.domain.com python3.6[1855]: Found uvloop, using it for optimal performance
Jan 17 07:38:53 server.domain.com python3.6[1855]: Got cert from the MASK_HOST www.cloudflare.com, its length is 2177
  • Do i need to do anything for the TLS Host E.G registoring something, Or as a fake TLS i should just fill in the Hostname?
  • Is anything wrong in my config file such as modes ETC which may not be compatible with some devices? If Yes, What modes should i choose?

I'm running Centos 7.7 on a server with 1 CPU Core and 1024MB of ram if it helps.
Thanks in advance!

Centos7 正常。总是掉线。

Important

  • Please note that I'm not responsible if your server is blocked.
  • If your proxy does not work at all, please try again with a VPN and if it works, do not submit an issue.
  • Remove these lines before opening an issue.

Describe the bug
A clear and concise description of what the bug is.

Server:

  • Server OS:
  • Which script did you used? (Note that you must not open an issue about erlang script here)

No Connected

Slm vaghti python script ro nasb mikonam kollan proxy vasl nmishe vali vaghti official script ro nasb mikonam moshkeli nadare
moshkel kojast?

what is limit ?

Hello
thank you for your script
the question is "What exactly the limit is?"
number of users or number of devics ?

for example if i set it 1 can i use the proxy both in my android and desktop?

running on multiple port in Python Proxy

Hi
Is there any possibility to run this proxy on multiple ports at the same time? I know it is possible to have multiple secrets on a single port but I could not figure out how I could run the proxy on multiple ports with different secrets. Would be helpful to advise. Thanks

关于代理限速的问题

你好,感谢你的工作,我用你的脚本一键安装了MTProto代理,可以完美运行,但是很奇怪为什么会被限速,最高速度也才500K/s,而我的v2ray高峰速度为10M左右,所以很奇怪为什么会被限速,请问如何调整参数?
我从网上找别人分享的MTProto代理,速度也比我这个快,所以我觉得应该是哪个参数的问题,所以请教你如何调整,望告知,谢谢你!

是安全模式的问题吗?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.