Add support for proxy again

This commit is contained in:
Lonami Exo
2018-10-04 17:11:31 +02:00
parent db83709c6b
commit ebde3be820
7 changed files with 65 additions and 35 deletions

View File

@@ -10,12 +10,12 @@ class ConnectionTcpFull(Connection):
Default Telegram mode. Sends 12 additional bytes and
needs to calculate the CRC value of the packet itself.
"""
def __init__(self, ip, port, *, loop):
super().__init__(ip, port, loop=loop)
def __init__(self, ip, port, *, loop, proxy=None):
super().__init__(ip, port, loop=loop, proxy=proxy)
self._send_counter = 0
async def connect(self, timeout=None):
await super().connect(timeout=timeout)
async def connect(self, timeout=None, ssl=None):
await super().connect(timeout=timeout, ssl=ssl)
self._send_counter = 0 # Important or Telegram won't reply
def _send(self, data):