Merge pull request #2240 from lightos/master

Support for timeout param when using Websockets
This commit is contained in:
Miroslav Stampar 2016-10-21 13:03:08 +02:00 committed by GitHub
commit 98c6d8f582

View File

@ -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()