Giter VIP home page Giter VIP logo

mtprotoproxy's People

Contributors

alexbers avatar alisontnt avatar allineer avatar amlor avatar azatarslanov avatar dasmfm avatar erfantkerfan avatar freekzy avatar ishift avatar k900 avatar pasha-zzz avatar peterdavehello avatar pouryare avatar themiron 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  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

mtprotoproxy's Issues

Not Opening photo And video

I tested this software on the server
posting of photos and content is goods
But there's a problem opening photos and videos .
This seems to be due to the limited Telegram IP in the TG_DATACENTERS section.
please check this problem.
thanks .

Socket leak

On the latest master 0778060 with AD_TAG enabled still get those kind of errors:

Fatal write error on socket transport
protocol: <asyncio.streams.StreamReaderProtocol object at 0x7f0a312a9fd0>
transport: <_SelectorSocketTransport closing fd=801 read=idle write=<idle, bufsize=0>>
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/selector_events.py", line 723, in _write_ready
    n = self._sock.send(self._buffer)
TimeoutError: [Errno 110] Connection timed out

<..>

Fatal read error on socket transport
protocol: <asyncio.streams.StreamReaderProtocol object at 0x7f0a2daa5940>
transport: <_SelectorSocketTransport fd=792 read=polling write=<idle, bufsize=0>>
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/selector_events.py", line 662, in _read_ready
    data = self._sock.recv(self.max_size)
TimeoutError: [Errno 110] Connection timed out
Fatal read error on socket transport
protocol: <asyncio.streams.StreamReaderProtocol object at 0x7f0a2d815ef0>
transport: <_SelectorSocketTransport fd=1557 read=polling write=<idle, bufsize=0>>
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/selector_events.py", line 662, in _read_ready
    data = self._sock.recv(self.max_size)
TimeoutError: [Errno 110] Connection timed out

<..>

Fatal read error on socket transport
protocol: <asyncio.streams.StreamReaderProtocol object at 0x7f0a30fa0c18>
transport: <_SelectorSocketTransport fd=3524 read=polling write=<polling, bufsize=10611>>
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/selector_events.py", line 662, in _read_ready
    data = self._sock.recv(self.max_size)
TimeoutError: [Errno 110] Connection timed out
Stats for 07.06.2018 11:14:48
tg: 357181 connects (974 current), 8927.98 MB

Stats for 07.06.2018 11:15:18
tg: 357339 connects (985 current), 8945.99 MB

Fatal read error on socket transport
protocol: <asyncio.streams.StreamReaderProtocol object at 0x7f0a30c5ff28>
transport: <_SelectorSocketTransport fd=1520 read=polling write=<idle, bufsize=0>>
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/selector_events.py", line 662, in _read_ready
    data = self._sock.recv(self.max_size)
TimeoutError: [Errno 110] Connection timed out

So, both send and recv despite the fix from 0778060#diff-e2b821dc5d96409f0102669d33aa8637R671

Unfortunately stacktrace doesn't say much on asyncio, so, my guess is that it fails somewhere during handshake.

And it looks like it causes socket leaks:

screenshot from 2018-06-07 13-19-26

This peak to 40k was before latest patch (definitely leak) and what I have now is better, but it still grows.

Proxy not working when i set AD_TAG

Hi, When AD_TAG is set proxy not working anymore...

PORT = 3259

# name -> secret (32 hex chars)
USERS = {
    "tg":  "0123456789abcdef0123456789abcdef"
}

# Tag for advertising, obtainable from @MTProxybot

AD_TAG = "02b86204e28dfceda581080dd966179c"

encrypt traffics!!

hi
master.
you can select option for encrypt traffics with P2P or PGP ?
this option can help we for unban proxys

Loop Problem (Windows)

Can you fix windows specific loop please?
Common one only support 64 simultaneous connection
And windows specific one doesn't download photos

Thanks for this super script

[WinError 121] The semaphore timeout period has expired

Such errors often appear in the output. However, this doesn't seem to affect the quality of the connection.
Windows 10 Build 17692, Python 3.7.0

Fatal read error on pipe transport
protocol: <asyncio.streams.StreamReaderProtocol object at 0x000002A9FF98A940>
transport: <_ProactorSocketTransport fd=748>
Traceback (most recent call last):
  File "C:\...\Python37\lib\asyncio\proactor_events.py", line 255, in _loop_reading
    data = fut.result()
  File "C:\...\Python37\lib\asyncio\windows_events.py", line 732, in _poll
    value = callback(transferred, key, ov)
  File "C:\...\Python37\lib\asyncio\windows_events.py", line 428, in finish_recv
    return ov.getresult()
OSError: [WinError 121] The semaphore timeout period has expired

High cpu utilization on file upload

Hello. I've tested this server software and it works great though if I send some file (Only one client was connected) the server CPU gets 100% load. I believe it is because of encryption, but I'm not python expert.

When multiple people connect, the proxy will be disconnected

When more than a few people are connected, the proxy is interrupted by the following error :

Traceback (most recent call last):
File "mtprotoproxy.py", line 769, in
main()
File "mtprotoproxy.py", line 750, in main
loop.run_forever()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\asyncio\base_events.py", line 523, in run_forever
self._run_once()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\asyncio\base_events.py", line 1713, in _run_once
event_list = self._selector.select(timeout)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\selectors.py", line 323, in select
r, w, _ = self._select(self._readers, self._writers, [], timeout)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\selectors.py", line 314, in _select
r, w, x = select.select(r, w, w, timeout)
ValueError: too many file descriptors in select()

Disable IPv6

I tried to set PREFER_IPV6 = False in config.py but mtprotoproxy is still running on ipv6 interface.

Is it available to fully disable IPv6?

Error: Failed to determine your ip, advertising disabled

I get this error:

Failed to determine your ip, advertising disabled

i entered my ip here: ip_addrs = ["YOUR_IP"]

i can connect successfully to proxy but i don want get this error

whats problem? why my advertising disabled?

Ansible module (and couple of questions)

Hello! I wrote a simple ansible role for easy mtprotoproxy installation: https://github.com/rlex/ansible-role-mtprotoproxy
Might be useful for those who deploy bunch of proxies.

Also, is it possible to either move config.py to separate location (ie config.py.template) or maybe document mtprotoproxy.py arguments (ie that you can use config path after it to load something different than config.py)? It's not quite obvious and editing config.py while in working tree is not great idea, especially if you fetch changes pretty often.

Error on set Channel Advertising

Hi all
i install py3.7
on set channel advertising and run it return this error:

SSL handshake failed on verifying the certificate
protocol: <asyncio.sslproto.SSLProtocol object at 0x03313E10>
transport: <_ProactorSocketTransport fd=356 read=<_OverlappedFuture pending over
lapped=<pending, 0x356e398> cb=[_ProactorReadPipeTransport._loop_reading()]>>
Traceback (most recent call last):
File "C:\Users\reza\AppData\Local\Programs\Python\Python37-32\lib\asyncio\sslp
roto.py", line 625, in _on_handshake_complete
raise handshake_exc
File "C:\Users\reza\AppData\Local\Programs\Python\Python37-32\lib\asyncio\sslp
roto.py", line 189, in feed_ssldata
self._sslobj.do_handshake()
File "C:\Users\reza\AppData\Local\Programs\Python\Python37-32\lib\ssl.py", lin
e 763, in do_handshake
self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verif
y failed: self signed certificate in certificate chain (_ssl.c:1045)
SSL error in data received
protocol: <asyncio.sslproto.SSLProtocol object at 0x03313E10>
transport: <_ProactorSocketTransport closing fd=356>
Traceback (most recent call last):
File "C:\Users\reza\AppData\Local\Programs\Python\Python37-32\lib\asyncio\sslp
roto.py", line 526, in data_received
ssldata, appdata = self._sslpipe.feed_ssldata(data)
File "C:\Users\reza\AppData\Local\Programs\Python\Python37-32\lib\asyncio\sslp
roto.py", line 189, in feed_ssldata
self._sslobj.do_handshake()
File "C:\Users\reza\AppData\Local\Programs\Python\Python37-32\lib\ssl.py", lin
e 763, in do_handshake
self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verif
y failed: self signed certificate in certificate chain (_ssl.c:1045)
Error updating middle proxy list
SSL handshake failed on verifying the certificate
protocol: <asyncio.sslproto.SSLProtocol object at 0x0356AC10>
transport: <_ProactorSocketTransport fd=356 read=<_OverlappedFuture pending over
lapped=<pending, 0x3a12600> cb=[_ProactorReadPipeTransport._loop_reading()]>>
Traceback (most recent call last):
File "C:\Users\reza\AppData\Local\Programs\Python\Python37-32\lib\asyncio\sslp
roto.py", line 625, in _on_handshake_complete
raise handshake_exc
File "C:\Users\reza\AppData\Local\Programs\Python\Python37-32\lib\asyncio\sslp
roto.py", line 189, in feed_ssldata
self._sslobj.do_handshake()
File "C:\Users\reza\AppData\Local\Programs\Python\Python37-32\lib\ssl.py", lin
e 763, in do_handshake
self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verif
y failed: self signed certificate in certificate chain (_ssl.c:1045)
SSL error in data received
protocol: <asyncio.sslproto.SSLProtocol object at 0x0356AC10>
transport: <_ProactorSocketTransport closing fd=356>
Traceback (most recent call last):
File "C:\Users\reza\AppData\Local\Programs\Python\Python37-32\lib\asyncio\sslp
roto.py", line 526, in data_received
ssldata, appdata = self._sslpipe.feed_ssldata(data)
File "C:\Users\reza\AppData\Local\Programs\Python\Python37-32\lib\asyncio\sslp
roto.py", line 189, in feed_ssldata
self._sslobj.do_handshake()
File "C:\Users\reza\AppData\Local\Programs\Python\Python37-32\lib\ssl.py", lin
e 763, in do_handshake
self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verif
y failed: self signed certificate in certificate chain (_ssl.c:1045)
Error updating middle proxy list for IPv6
SSL handshake failed on verifying the certificate
protocol: <asyncio.sslproto.SSLProtocol object at 0x04085F70>
transport: <_ProactorSocketTransport fd=588 read=<_OverlappedFuture pending over
lapped=<pending, 0x40a68c0> cb=[_ProactorReadPipeTransport._loop_reading()]>>
Traceback (most recent call last):
File "C:\Users\reza\AppData\Local\Programs\Python\Python37-32\lib\asyncio\sslp
roto.py", line 625, in _on_handshake_complete
raise handshake_exc
File "C:\Users\reza\AppData\Local\Programs\Python\Python37-32\lib\asyncio\sslp
roto.py", line 189, in feed_ssldata
self._sslobj.do_handshake()
File "C:\Users\reza\AppData\Local\Programs\Python\Python37-32\lib\ssl.py", lin
e 763, in do_handshake
self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verif
y failed: self signed certificate in certificate chain (_ssl.c:1045)
SSL error in data received
protocol: <asyncio.sslproto.SSLProtocol object at 0x04085F70>
transport: <_ProactorSocketTransport closing fd=588>
Traceback (most recent call last):
File "C:\Users\reza\AppData\Local\Programs\Python\Python37-32\lib\asyncio\sslp
roto.py", line 526, in data_received
ssldata, appdata = self._sslpipe.feed_ssldata(data)
File "C:\Users\reza\AppData\Local\Programs\Python\Python37-32\lib\asyncio\sslp
roto.py", line 189, in feed_ssldata
self._sslobj.do_handshake()
File "C:\Users\reza\AppData\Local\Programs\Python\Python37-32\lib\ssl.py", lin
e 763, in do_handshake
self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verif
y failed: self signed certificate in certificate chain (_ssl.c:1045)
Error updating middle proxy secret, using old
Fatal read error on pipe transport
protocol: <asyncio.streams.StreamReaderProtocol object at 0x0431F930>
transport: <_ProactorSocketTransport fd=592>
Traceback (most recent call last):
File "C:\Users\reza\AppData\Local\Programs\Python\Python37-32\lib\asyncio\proa
ctor_events.py", line 255, in _loop_reading
data = fut.result()
File "C:\Users\reza\AppData\Local\Programs\Python\Python37-32\lib\asyncio\wind
ows_events.py", line 732, in _poll
value = callback(transferred, key, ov)
File "C:\Users\reza\AppData\Local\Programs\Python\Python37-32\lib\asyncio\wind
ows_events.py", line 428, in finish_recv
return ov.getresult()
OSError: [WinError 121] The semaphore timeout period has expired
Fatal read error on pipe transport
protocol: <asyncio.streams.StreamReaderProtocol object at 0x02947A50>
transport: <_ProactorSocketTransport fd=588>
Traceback (most recent call last):
File "C:\Users\reza\AppData\Local\Programs\Python\Python37-32\lib\asyncio\proa
ctor_events.py", line 255, in _loop_reading
data = fut.result()
File "C:\Users\reza\AppData\Local\Programs\Python\Python37-32\lib\asyncio\wind
ows_events.py", line 732, in _poll
value = callback(transferred, key, ov)
File "C:\Users\reza\AppData\Local\Programs\Python\Python37-32\lib\asyncio\wind
ows_events.py", line 428, in finish_recv
return ov.getresult()
OSError: [WinError 121] The semaphore timeout period has expired
Exception in callback _ProactorBaseWritePipeTransport._loop_writing(<_Overlapped
Future cancelled>)
handle: <Handle _ProactorBaseWritePipeTransport._loop_writing(<_OverlappedFuture
cancelled>)>
Traceback (most recent call last):
File "C:\Users\reza\AppData\Local\Programs\Python\Python37-32\lib\asyncio\even
ts.py", line 88, in _run
self._context.run(self._callback, *self._args)
File "C:\Users\reza\AppData\Local\Programs\Python\Python37-32\lib\asyncio\proa
ctor_events.py", line 346, in _loop_writing
assert f is self._write_fut
AssertionError
Fatal read error on pipe transport
protocol: <asyncio.streams.StreamReaderProtocol object at 0x02947D50>
transport: <_ProactorSocketTransport fd=848>
Traceback (most recent call last):
File "C:\Users\reza\AppData\Local\Programs\Python\Python37-32\lib\asyncio\proa
ctor_events.py", line 255, in _loop_reading
data = fut.result()
File "C:\Users\reza\AppData\Local\Programs\Python\Python37-32\lib\asyncio\wind
ows_events.py", line 732, in _poll
value = callback(transferred, key, ov)
File "C:\Users\reza\AppData\Local\Programs\Python\Python37-32\lib\asyncio\wind
ows_events.py", line 428, in finish_recv
return ov.getresult()
OSError: [WinError 121] The semaphore timeout period has expired

Timeouts

Hey! I would like to suggest you to use timeouts for read/write operations as I do, for example, for mtg.

The rationale is quite simple: we might have some harmful clients (even attackers) who can write, let's say, 32 bytes for initial connection and send nothing after that. In that case, we would have an open socket for the infinite amount of time which can lead to the resource leak. Also, it would be trivial to destroy the proxy in such a way (just imagine, a small fleet of 20-30 machines which will do that for the proxy). Also, it helps to disconnect stale clients.

For mtg, I found out that 30 seconds is enough to have a great user experience. Nobody notices such timeouts on generic usage but I see these timeouts from time to time in the logs.

Cannot start mtprotoproxy.py

Hello!

$ python3 mtprotoproxy.py
  File "mtprotoproxy.py", line 242
    async def read(self, n):
            ^
SyntaxError: invalid syntax

$ cat /etc/centos-release
CentOS Linux release 7.5.1804 (Core) 

$ python3 --version
Python 3.4.8

$ python --version
Python 2.7.5

$ pip -V
pip 10.0.1 from /usr/lib/python3.4/site-packages/pip (python 3.4)

$ pip list
Package      Version
------------ -------
pip          10.0.1 
pycryptodome 3.6.4  
setuptools   40.0.0 
wheel        0.31.1 

What am I missing?

no logs

i don't get any logs with
docker-compose logs

if i run
without docker - i get logs

What is beta secret?

Hi
What is the beta secret that starts with dd? Does it enable the random padding feature?

Interface or IP binding

Hello. Is there any ways to bind proxy to the interface or ip address? I have a lot of IPs on the server and the proxy use all of them after start so I want to limit it and bind to the dedicated IP address.

Error "Fatal read error on pipe transport"

Fatal read error on pipe transport
protocol: <asyncio.streams.StreamReaderProtocol object at 0x03B24410>
transport: <_ProactorSocketTransport closing fd=536>
Traceback (most recent call last):
File "C:\Users-----\AppData\Local\Programs\Python\Python37-32\lib\asyncio\proactor_events.py", line 255, in _loop_reading
data = fut.result()
File "C:\Users-----\AppData\Local\Programs\Python\Python37-32\lib\asyncio\windows_events.py", line 732, in _poll
value = callback(transferred, key, ov)
File "C:\Users-----\AppData\Local\Programs\Python\Python37-32\lib\asyncio\windows_events.py", line 428, in finish_recv
return ov.getresult()
OSError: [WinError 121] The semaphore timeout period has expired

proxy -> telegram connection multiplexing

It looks like it's possible to multiplex many client -> proxy connections into single proxy -> telegram server connection based on RPC connection ID

ans_type, ans_flags, conn_id, conn_data = data[:4], data[4:8], data[8:16], data[16:]

self.out_conn_id = bytearray([random.randrange(0, 256) for i in range(8)])

You just have to maintain mapping between client -> proxy and proxy -> telegram sockets and send packets as a whole. And, probably, you will need to have some kind of proxy -> telegram connection pool (separate pool for each dc_id)

Unable to connect to some IPs

After making 'systemctl status MTProxy' I noticed these messages:

Aug 03 22:43:28 ubuntu python3.7[984]: Unable to connect to 149.154.175.50 443
Aug 03 22:43:28 ubuntu python3.7[984]: Unable to connect to 149.154.175.100 443
Aug 03 22:43:36 ubuntu python3.7[984]: Unable to connect to 149.154.175.100 443
Aug 03 22:43:36 ubuntu python3.7[984]: Unable to connect to 149.154.175.50 443
Aug 03 22:43:44 ubuntu python3.7[984]: Unable to connect to 149.154.175.100 443
Aug 03 22:43:44 ubuntu python3.7[984]: Unable to connect to 149.154.175.50 443
Aug 03 22:43:52 ubuntu python3.7[984]: Unable to connect to 149.154.175.50 443
Aug 03 22:43:52 ubuntu python3.7[984]: Unable to connect to 149.154.175.100 443
Aug 03 22:44:00 ubuntu python3.7[984]: Unable to connect to 149.154.175.100 443
Aug 03 22:44:00 ubuntu python3.7[984]: Unable to connect to 149.154.175.50 443

Is it some VPS-side problem or may be something wrong with those telegram servers?

Windows Server Problem

I run your mtproto successfully but cant connect to any client like Telegram Android or Telegram Desktop

untitled

force users to use RANDOM PADDING mode

is it possible to fully disable normal mode and ENABLE RANDOM PADDING mode ONLY . if some users connect without random padding don't serv them or block their ip address .
because without random padding , server will be detect by ISP and IP of server will fully block in whole country.
some users don't using 'dd' i don't know why . if i add 'dd' they manualy remove it !!! and cause server BAN !
everytime afew users cause the whole server block ! i need to block those users .
thanks for this project

Questions

DD and ipv6 support, implement in this proxy?

Cannot Connect to the server

Hello, I am using this script for installing mtproto and when I try to connect to it the client starts trying to connect and it changes state between online and connecting and never connects.
I have checked my firewall and opened the port but no success.

crash after one minute

the proxy was working without any problem til this morning.
after i run the proxy is works for one minute or so then crashes with this error:

Task exception was never retrieved future: <Task finished coro=<IocpProactor.accept.<locals>.accept_coro() done, defined at C:\Users\Administrator\AppData\Local\Programs\Python\Python37-32\lib\asyncio\windows_events.py:496> exception=OSError(22, 'The specified network name is no longer available', None, 64, None)> Traceback (most recent call last): File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37-32\lib\asyncio\windows_events.py", line 499, in accept_coro await future File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37-32\lib\asyncio\windows_events.py", line 732, in _poll value = callback(transferred, key, ov) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37-32\lib\asyncio\windows_events.py", line 488, in finish_accept ov.getresult() OSError: [WinError 64] The specified network name is no longer available Accept failed on a socket socket: <socket.socket fd=612, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('0.0.0.0', 6969)> Traceback (most recent call last): File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37-32\lib\asyncio\proactor_events.py", line 637, in loop conn, addr = f.result() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37-32\lib\asyncio\windows_events.py", line 499, in accept_coro await future File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37-32\lib\asyncio\windows_events.py", line 732, in _poll value = callback(transferred, key, ov) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37-32\lib\asyncio\windows_events.py", line 488, in finish_accept ov.getresult() OSError: [WinError 64] The specified network name is no longer available

Slow Connecting...

I have the server running on a dual core and 4 GO RAM, but the problem is the time that it takes to connect to the proxy is too much, sometimes the ping is 3xxx ms. but after connecting, the speed is charming.
I have even tried to set
FAST_MODE = True
But no luck, the server is super fast at ping running other MTproto server implementations.
Anyone with the same problem or a tip?

Can't bind to 443 port with docker

Command to run: sudo docker-compose up --build -d.

Output:

4ace7a4bf7b0_proxy_mtprotoproxy_1 | Traceback (most recent call last):
4ace7a4bf7b0_proxy_mtprotoproxy_1 |   File "./mtprotoproxy.py", line 1014, in <module>
4ace7a4bf7b0_proxy_mtprotoproxy_1 |     main()
4ace7a4bf7b0_proxy_mtprotoproxy_1 |   File "./mtprotoproxy.py", line 987, in main
4ace7a4bf7b0_proxy_mtprotoproxy_1 |     server_v4 = loop.run_until_complete(task_v4)
4ace7a4bf7b0_proxy_mtprotoproxy_1 |   File "/usr/lib/python3.6/asyncio/base_events.py", line 466, in run_until_complete
4ace7a4bf7b0_proxy_mtprotoproxy_1 |     return future.result()
4ace7a4bf7b0_proxy_mtprotoproxy_1 |   File "/usr/lib/python3.6/asyncio/streams.py", line 113, in start_server
4ace7a4bf7b0_proxy_mtprotoproxy_1 |     return (yield from loop.create_server(factory, host, port, **kwds))
4ace7a4bf7b0_proxy_mtprotoproxy_1 |   File "/usr/lib/python3.6/asyncio/base_events.py", line 1047, in create_server
4ace7a4bf7b0_proxy_mtprotoproxy_1 |     % (sa, err.strerror.lower()))
4ace7a4bf7b0_proxy_mtprotoproxy_1 | PermissionError: [Errno 13] error while attempting to bind on address ('0.0.0.0', 443): permission denied

Official proxy binds fine on 443 port (on the same server).

error

Hi, i have error
mtproto proxy can't start
914cc1ca08777195114a5c18c7506174

multiple mtproto servers

How can I run multiple mtproto servers simultaneously on different ports and different secrets and different channel_tags with multiple configs?

When I build the second one with docker-compose it erases the first one.

Respond time

Hi. When I use official mtproxy on the client it shows about 70ms ping. But when I use mtprotoproxy installed on the same server my client shows about 230ms ping. It’s about four times slower! Could someone explain why?

get error after restart

i try to run this script in my windows server 2012
it worked and my proxy installed but when i restart CMD and run again script by this command (python mtprotoproxy.py) i get this error :

f (beta)
Traceback (most recent call last):
File "mtprotoproxy.py", line 1134, in
main()
File "mtprotoproxy.py", line 1107, in main
server_v4 = loop.run_until_complete(task_v4)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\asynci
o\base_events.py", line 568, in run_until_complete
return future.result()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\asynci
o\streams.py", line 114, in start_server
return await loop.create_server(factory, host, port, **kwds)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\asynci
o\base_events.py", line 1361, in create_server
% (sa, err.strerror.lower())) from None
OSError: [Errno 10048] error while attempting to bind on address ('0.0.0.0', 8580): only one usage of each socket address (protocol/network address/port) is nor
mally permitted

For some reason, I have to run on port 8580
How can i fix this error?

limit users that can use proxy/secret

hello.i want to know is there way to limit the number of users that use a specific secret.for example only 32 people can use a specific secret.

if not,i don't know how to do it and i'm not familiar with mtproto proxy scheme.but i can change the code(and maybe PR if my code is usable).But i do need some help.
should it be limited by the number of IP's that are connected to a secret or do we have a ID for every single USER that connects to the secret?(and by secret i mean single secret not the whole proxy)

also can you hint me the lines that accept a connection,process them,where are open connection saved?

invalid syntax mtprotoproxy.py

when i was run mtprotoproxy i got this error:
root@xxxxxx:/opt/mtprotoproxy# python3 mtprotoproxy.py File "mtprotoproxy.py", line 159 async def read(self, n): ^ SyntaxError: invalid syntax

Help me docker compose

root@DeaD:~/mtprotoproxy# docker-compose up --build -d
Traceback (most recent call last):
File "/usr/bin/docker-compose", line 9, in
load_entry_point('docker-compose==1.8.0', 'console_scripts', 'docker-compose')()
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 542, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 2569, in load_entry_point
return ep.load()
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 2229, in load
return self.resolve()
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 2235, in resolve
module = import(self.module_name, fromlist=['name'], level=0)
File "/usr/lib/python2.7/dist-packages/compose/cli/main.py", line 14, in
from . import errors
File "/usr/lib/python2.7/dist-packages/compose/cli/errors.py", line 9, in
from docker.errors import APIError
File "/usr/lib/python2.7/dist-packages/docker/init.py", line 20, in
from .client import Client, AutoVersionClient, from_env # flake8: noqa
File "/usr/lib/python2.7/dist-packages/docker/client.py", line 18, in
import requests
File "/usr/lib/python2.7/dist-packages/requests/init.py", line 53, in
from .packages.urllib3.contrib import pyopenssl
File "/usr/lib/python2.7/dist-packages/urllib3/contrib/pyopenssl.py", line 54, in
import OpenSSL.SSL
File "/usr/lib/python2.7/dist-packages/OpenSSL/init.py", line 8, in
from OpenSSL import rand, crypto, SSL
File "/usr/lib/python2.7/dist-packages/OpenSSL/SSL.py", line 118, in
SSL_ST_INIT = _lib.SSL_ST_INIT
AttributeError: 'module' object has no attribute 'SSL_ST_INIT'

Version 1.0.0 has less perfromance, than 0.9.5

Hi,

After switching to version 1.0.0, I found, that clients may transfer data with less 250Kb/s. Version 0.9.5 executed on the same machine in separate docker provide 2,5Mb/s.
I changed size of buffer TO_CLT_BUFSIZE = 16384 via config.py and speed was improved to 510Kb/s (v1.0.0).
Both tests was done on the same physical machine, with different docker containers, the same secrets and the same clients(desktop and Android). If I switch to "secure" secret, I've also get less performance rate(v1.0.0).

Have you got any suggestions, why new version may be slower on the same secrets?

Installation process in windows

Hi dear @alexbers .
As you mentioned in this issue:
TelegramMessenger/MTProxy#31
I wonder if you can help me with installation process.
I know how to install python in Windows.
But i Do not know how to install this source code on windows.
Please give me the commands that i can install&launch mtprotoproxy in Python(windows).
I’ll do my best to publish your REP and make it to the most known mtproxy source code.
Regards,
Reza

Stats Problem

MTProxy Bot never show me stats:

Sorry, we don't have stats for your proxy yet. Please come back later.

I changed port and secret key and tag but problem is remaining

I have another server and stats working fine
But in my new server i have stat problem

Advertising channel does not show anymore

Hi, guys!

So, I did notice lately that all of our proxies are showing currently without any ads, even thought we didn't made any changes. The only thing which we made is change IP address several times for each domain.
There is still the same AD_TAG and domain is added via Telegram bot.

I tried to remove and add the proxy via bot, but it does not help and you get the same AD_TAG.

#UPD Seems like ads disappear after you change IP for a proxy domain, any workaround?

Solution: Seems like you have to remove promotion, then add it again. It may take several hours.

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.