Skip to content

Commit

Permalink
Add WebSocket ping and pong hook
Browse files Browse the repository at this point in the history
  • Loading branch information
hans00 committed May 19, 2020
1 parent 8077c5a commit 903496d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,12 @@ class fastWS {
drain: (ws) => {
ws.client.drain()
},
ping: (ws) => {
ws.client.onPing()
},
pong: (ws) => {
ws.client.onPong()
},
close: (ws, code, message) => {
ws.client.onClose(code, message)
setImmediate(() => delete ws.client)
Expand Down

0 comments on commit 903496d

Please sign in to comment.