Support for timeout param when using Websockets

A fix for the timeout parameter being ignored when using Web-sockets.
This commit is contained in:
Roberto Salgado 2016-10-20 12:13:39 -07:00 committed by GitHub
parent 5c80e988ba
commit a6cbbc5ea9

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