mirror of
https://github.com/TeamPGM/pyrogram.git
synced 2024-11-17 21:22:40 +00:00
Make the underlying TCP protocol accept ipv6 addresses
This commit is contained in:
parent
efe26bcb19
commit
56748ff390
@ -33,8 +33,9 @@ log = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
class TCP(socks.socksocket):
|
class TCP(socks.socksocket):
|
||||||
def __init__(self, proxy: dict):
|
def __init__(self, ipv6: bool, proxy: dict):
|
||||||
super().__init__()
|
super().__init__(family=socket.AF_INET6 if ipv6 else socket.AF_INET)
|
||||||
|
|
||||||
self.settimeout(10)
|
self.settimeout(10)
|
||||||
self.proxy_enabled = proxy.get("enabled", False)
|
self.proxy_enabled = proxy.get("enabled", False)
|
||||||
|
|
||||||
|
@ -24,8 +24,8 @@ log = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
class TCPAbridged(TCP):
|
class TCPAbridged(TCP):
|
||||||
def __init__(self, proxy: dict):
|
def __init__(self, ipv6: bool, proxy: dict):
|
||||||
super().__init__(proxy)
|
super().__init__(ipv6, proxy)
|
||||||
|
|
||||||
def connect(self, address: tuple):
|
def connect(self, address: tuple):
|
||||||
super().connect(address)
|
super().connect(address)
|
||||||
|
@ -28,8 +28,9 @@ log = logging.getLogger(__name__)
|
|||||||
class TCPAbridgedO(TCP):
|
class TCPAbridgedO(TCP):
|
||||||
RESERVED = (b"HEAD", b"POST", b"GET ", b"OPTI", b"\xee" * 4)
|
RESERVED = (b"HEAD", b"POST", b"GET ", b"OPTI", b"\xee" * 4)
|
||||||
|
|
||||||
def __init__(self, proxy: dict):
|
def __init__(self, ipv6: bool, proxy: dict):
|
||||||
super().__init__(proxy)
|
super().__init__(ipv6, proxy)
|
||||||
|
|
||||||
self.encrypt = None
|
self.encrypt = None
|
||||||
self.decrypt = None
|
self.decrypt = None
|
||||||
|
|
||||||
|
@ -26,8 +26,9 @@ log = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
class TCPFull(TCP):
|
class TCPFull(TCP):
|
||||||
def __init__(self, proxy: dict):
|
def __init__(self, ipv6: bool, proxy: dict):
|
||||||
super().__init__(proxy)
|
super().__init__(ipv6, proxy)
|
||||||
|
|
||||||
self.seq_no = None
|
self.seq_no = None
|
||||||
|
|
||||||
def connect(self, address: tuple):
|
def connect(self, address: tuple):
|
||||||
|
@ -25,8 +25,8 @@ log = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
class TCPIntermediate(TCP):
|
class TCPIntermediate(TCP):
|
||||||
def __init__(self, proxy: dict):
|
def __init__(self, ipv6: bool, proxy: dict):
|
||||||
super().__init__(proxy)
|
super().__init__(ipv6, proxy)
|
||||||
|
|
||||||
def connect(self, address: tuple):
|
def connect(self, address: tuple):
|
||||||
super().connect(address)
|
super().connect(address)
|
||||||
|
@ -29,8 +29,9 @@ log = logging.getLogger(__name__)
|
|||||||
class TCPIntermediateO(TCP):
|
class TCPIntermediateO(TCP):
|
||||||
RESERVED = (b"HEAD", b"POST", b"GET ", b"OPTI", b"\xee" * 4)
|
RESERVED = (b"HEAD", b"POST", b"GET ", b"OPTI", b"\xee" * 4)
|
||||||
|
|
||||||
def __init__(self, proxy: dict):
|
def __init__(self, ipv6: bool, proxy: dict):
|
||||||
super().__init__(proxy)
|
super().__init__(ipv6, proxy)
|
||||||
|
|
||||||
self.encrypt = None
|
self.encrypt = None
|
||||||
self.decrypt = None
|
self.decrypt = None
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user