Fix connection to proxy

Fix the proxy bug.

Signed-off-by: wulan17 <wulan17@komodos.id>
This commit is contained in:
S!R X 2024-07-23 10:21:35 +03:30 committed by wulan17
parent b8028541c9
commit 921b593285
No known key found for this signature in database
GPG key ID: 737814D4B5FF0420

View file

@ -21,6 +21,7 @@ import asyncio
import ipaddress
import logging
import socket
from concurrent.futures import ThreadPoolExecutor
from typing import Tuple, Dict, TypedDict, Optional
import socks
@ -91,10 +92,8 @@ class TCP:
)
sock.settimeout(TCP.TIMEOUT)
await self.loop.sock_connect(
sock=sock,
address=destination
)
with ThreadPoolExecutor() as executor:
await self.loop.run_in_executor(executor, sock.connect, destination)
sock.setblocking(False)