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):
|
||||
def __init__(self, proxy: dict):
|
||||
super().__init__()
|
||||
def __init__(self, ipv6: bool, proxy: dict):
|
||||
super().__init__(family=socket.AF_INET6 if ipv6 else socket.AF_INET)
|
||||
|
||||
self.settimeout(10)
|
||||
self.proxy_enabled = proxy.get("enabled", False)
|
||||
|
||||
|
@ -24,8 +24,8 @@ log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class TCPAbridged(TCP):
|
||||
def __init__(self, proxy: dict):
|
||||
super().__init__(proxy)
|
||||
def __init__(self, ipv6: bool, proxy: dict):
|
||||
super().__init__(ipv6, proxy)
|
||||
|
||||
def connect(self, address: tuple):
|
||||
super().connect(address)
|
||||
|
@ -28,8 +28,9 @@ log = logging.getLogger(__name__)
|
||||
class TCPAbridgedO(TCP):
|
||||
RESERVED = (b"HEAD", b"POST", b"GET ", b"OPTI", b"\xee" * 4)
|
||||
|
||||
def __init__(self, proxy: dict):
|
||||
super().__init__(proxy)
|
||||
def __init__(self, ipv6: bool, proxy: dict):
|
||||
super().__init__(ipv6, proxy)
|
||||
|
||||
self.encrypt = None
|
||||
self.decrypt = None
|
||||
|
||||
|
@ -26,8 +26,9 @@ log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class TCPFull(TCP):
|
||||
def __init__(self, proxy: dict):
|
||||
super().__init__(proxy)
|
||||
def __init__(self, ipv6: bool, proxy: dict):
|
||||
super().__init__(ipv6, proxy)
|
||||
|
||||
self.seq_no = None
|
||||
|
||||
def connect(self, address: tuple):
|
||||
|
@ -25,8 +25,8 @@ log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class TCPIntermediate(TCP):
|
||||
def __init__(self, proxy: dict):
|
||||
super().__init__(proxy)
|
||||
def __init__(self, ipv6: bool, proxy: dict):
|
||||
super().__init__(ipv6, proxy)
|
||||
|
||||
def connect(self, address: tuple):
|
||||
super().connect(address)
|
||||
|
@ -29,8 +29,9 @@ log = logging.getLogger(__name__)
|
||||
class TCPIntermediateO(TCP):
|
||||
RESERVED = (b"HEAD", b"POST", b"GET ", b"OPTI", b"\xee" * 4)
|
||||
|
||||
def __init__(self, proxy: dict):
|
||||
super().__init__(proxy)
|
||||
def __init__(self, ipv6: bool, proxy: dict):
|
||||
super().__init__(ipv6, proxy)
|
||||
|
||||
self.encrypt = None
|
||||
self.decrypt = None
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user