Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Support for timeout param when using Websockets
A fix for the timeout parameter being ignored when using Web-sockets.
  • Loading branch information
lightos authored Oct 20, 2016
commit a6cbbc5ea9e00e898402b0bcf171eef86da0b6b2
1 change: 1 addition & 0 deletions lib/request/connect.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,7 @@ def getPage(**kwargs):

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