mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-22 18:07:21 +00:00
Workaround proxy sockets not timing out properly
This commit is contained in:
parent
52effe19d5
commit
cf06939a55
@ -20,6 +20,7 @@ import asyncio
|
|||||||
import ipaddress
|
import ipaddress
|
||||||
import logging
|
import logging
|
||||||
import socket
|
import socket
|
||||||
|
|
||||||
import socks
|
import socks
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
@ -58,6 +59,8 @@ class TCP:
|
|||||||
password=proxy.get("password", None)
|
password=proxy.get("password", None)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
self.socket.settimeout(TCP.TIMEOUT)
|
||||||
|
|
||||||
log.info("Using proxy %s", hostname)
|
log.info("Using proxy %s", hostname)
|
||||||
else:
|
else:
|
||||||
self.socket = socket.socket(
|
self.socket = socket.socket(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user