fix: 修复代理问题
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import socket
|
||||
from typing import Optional, Tuple
|
||||
|
||||
|
||||
def connect_tcp(
|
||||
host: str,
|
||||
port: int,
|
||||
timeout: Optional[float] = None,
|
||||
local_addr: Optional[Tuple[str, int]] = None,
|
||||
) -> socket.socket:
|
||||
address = (host, port)
|
||||
return socket.create_connection(
|
||||
address,
|
||||
timeout,
|
||||
source_address=local_addr,
|
||||
)
|
||||
Reference in New Issue
Block a user