Introduce a websocket ping check that closes the socket if no response.

This commit is contained in:
softsimon committed 2020-03-06 02:05:26 +07:00
1 parent c7ddeecd18
commit 550679f17e
2 files changed
+31 -4

No files matched your search

+4
View File
@@ -74,6 +74,10 @@ class WebsocketHandler {
'git-commit': this.latestGitCommitHash
}));
}
if (parsedMessage.action === 'ping') {
client.send(JSON.stringify({'pong': true}));
}
} catch (e) {
console.log(e);
}