From a6cbbc5ea9e00e898402b0bcf171eef86da0b6b2 Mon Sep 17 00:00:00 2001 From: Roberto Salgado Date: Thu, 20 Oct 2016 12:13:39 -0700 Subject: [PATCH] Support for timeout param when using Websockets A fix for the timeout parameter being ignored when using Web-sockets. --- lib/request/connect.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/request/connect.py b/lib/request/connect.py index 9ce386640..cb07b2743 100644 --- a/lib/request/connect.py +++ b/lib/request/connect.py @@ -396,6 +396,7 @@ class Connect(object): if websocket_: ws = websocket.WebSocket() + ws.settimeout(timeout) ws.connect(url, header=("%s: %s" % _ for _ in headers.items() if _[0] not in ("Host",)), cookie=cookie) # WebSocket will add Host field of headers automatically ws.send(urldecode(post or "")) page = ws.recv()