mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2025-12-29 12:04:51 +00:00
Update tcp.py
This commit is contained in:
parent
f7e64c6cb4
commit
f724347ddd
1 changed files with 2 additions and 4 deletions
|
|
@ -213,9 +213,7 @@ class SOCKS4Handler:
|
|||
writer: asyncio.StreamWriter,
|
||||
reader: asyncio.StreamReader,
|
||||
destination: Tuple[str, int],
|
||||
*,
|
||||
username: Optional[str] = None,
|
||||
timeout: int = 10,
|
||||
username: Optional[str] = None
|
||||
) -> None:
|
||||
"""Perform SOCKS4 handshake."""
|
||||
host, port = destination
|
||||
|
|
@ -224,7 +222,7 @@ class SOCKS4Handler:
|
|||
writer.write(request)
|
||||
await writer.drain()
|
||||
|
||||
response = await asyncio.wait_for(reader.read(8), timeout)
|
||||
response = await asyncio.wait_for(reader.read(8), 10)
|
||||
if len(response) != 8 or response[0] != 0x00 or response[1] != 0x5A:
|
||||
raise ConnectionError("SOCKS4 connection failed")
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue