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

Skip to content

Commit 98c6d8f

Browse files
authored
Merge pull request #2240 from lightos/master
Support for timeout param when using Websockets
2 parents d605b3a + a6cbbc5 commit 98c6d8f

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

lib/request/connect.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,7 @@ def getPage(**kwargs):
396396

397397
if websocket_:
398398
ws = websocket.WebSocket()
399+
ws.settimeout(timeout)
399400
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
400401
ws.send(urldecode(post or ""))
401402
page = ws.recv()

0 commit comments

Comments
 (0)