mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-11-13 04:20:37 +00:00
Merge pull request #1126 from seriyps/mtproto-proxy-other-protocols
Implement different MTProto proxy protocols
This commit is contained in:
@@ -9,7 +9,7 @@ from datetime import datetime, timezone
|
||||
from .. import version, __name__ as __base_name__
|
||||
from ..crypto import rsa
|
||||
from ..extensions import markdown
|
||||
from ..network import MTProtoSender, ConnectionTcpFull, ConnectionTcpMTProxy
|
||||
from ..network import MTProtoSender, ConnectionTcpFull, TcpMTProxy
|
||||
from ..sessions import Session, SQLiteSession, MemorySession
|
||||
from ..tl import TLObject, functions, types
|
||||
from ..tl.alltlobjects import LAYER
|
||||
@@ -64,7 +64,7 @@ class TelegramBaseClient(abc.ABC):
|
||||
|
||||
proxy (`tuple` | `list` | `dict`, optional):
|
||||
An iterable consisting of the proxy info. If `connection` is
|
||||
`ConnectionTcpMTProxy`, then it should contain MTProxy credentials:
|
||||
one of `MTProxy`, then it should contain MTProxy credentials:
|
||||
``('hostname', port, 'secret')``. Otherwise, it's meant to store
|
||||
function parameters for PySocks, like ``(type, 'hostname', port)``.
|
||||
See https://github.com/Anorov/PySocks#usage-1 for more.
|
||||
@@ -249,8 +249,8 @@ class TelegramBaseClient(abc.ABC):
|
||||
|
||||
assert isinstance(connection, type)
|
||||
self._connection = connection
|
||||
init_proxy = None if connection is not ConnectionTcpMTProxy else \
|
||||
types.InputClientProxy(*ConnectionTcpMTProxy.address_info(proxy))
|
||||
init_proxy = None if not issubclass(connection, TcpMTProxy) else \
|
||||
types.InputClientProxy(*connection.address_info(proxy))
|
||||
|
||||
# Used on connection. Capture the variables in a lambda since
|
||||
# exporting clients need to create this InvokeWithLayerRequest.
|
||||
|
||||
Reference in New Issue
Block a user