mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2026-01-07 15:34:52 +00:00
Fix connection to proxy
Fix the proxy bug. Signed-off-by: wulan17 <wulan17@komodos.id>
This commit is contained in:
parent
b8028541c9
commit
921b593285
1 changed files with 3 additions and 4 deletions
|
|
@ -21,6 +21,7 @@ import asyncio
|
||||||
import ipaddress
|
import ipaddress
|
||||||
import logging
|
import logging
|
||||||
import socket
|
import socket
|
||||||
|
from concurrent.futures import ThreadPoolExecutor
|
||||||
from typing import Tuple, Dict, TypedDict, Optional
|
from typing import Tuple, Dict, TypedDict, Optional
|
||||||
|
|
||||||
import socks
|
import socks
|
||||||
|
|
@ -91,10 +92,8 @@ class TCP:
|
||||||
)
|
)
|
||||||
sock.settimeout(TCP.TIMEOUT)
|
sock.settimeout(TCP.TIMEOUT)
|
||||||
|
|
||||||
await self.loop.sock_connect(
|
with ThreadPoolExecutor() as executor:
|
||||||
sock=sock,
|
await self.loop.run_in_executor(executor, sock.connect, destination)
|
||||||
address=destination
|
|
||||||
)
|
|
||||||
|
|
||||||
sock.setblocking(False)
|
sock.setblocking(False)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue