Skip to content

Commit

Permalink
Close websocket if there is no corresponding ssh connection
Browse files Browse the repository at this point in the history
  • Loading branch information
huashengdun committed Nov 21, 2022
1 parent 9a7cfe7 commit 2a46b52
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions webssh/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,13 @@ def on_message(self, message):
*self.src_addr
)
)
self.close(reason='No worker found')
return

if worker.closed:
self.close(reason='Worker closed')
return

try:
msg = json.loads(message)
except JSONDecodeError:
Expand Down

0 comments on commit 2a46b52

Please sign in to comment.