From 5e6361defc8c0f69076cefde800c4fc72c1263a5 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Thu, 15 Feb 2018 21:06:04 +0100 Subject: [PATCH] Set socket timeout to 10s --- pyrogram/connection/transport/tcp/tcp.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pyrogram/connection/transport/tcp/tcp.py b/pyrogram/connection/transport/tcp/tcp.py index 2ec899a7..a762a39e 100644 --- a/pyrogram/connection/transport/tcp/tcp.py +++ b/pyrogram/connection/transport/tcp/tcp.py @@ -30,6 +30,7 @@ Proxy = namedtuple("Proxy", ["enabled", "hostname", "port", "username", "passwor class TCP(socks.socksocket): def __init__(self, proxy: Proxy): super().__init__() + self.settimeout(10) self.proxy_enabled = False if proxy and proxy.enabled: