mirror of
https://github.com/streamwall/streamwall.git
synced 2026-01-26 15:12:47 -05:00
Periodically send ping to WebSocket
This may help keep the WebSocket alive in some firewall situations.
This commit is contained in:
@@ -57,8 +57,13 @@ function initApp({
|
||||
|
||||
ws.binaryType = 'arraybuffer'
|
||||
|
||||
const pingInterval = setInterval(() => {
|
||||
ws.ping()
|
||||
}, 20 * 1000)
|
||||
|
||||
ws.on('close', () => {
|
||||
sockets.delete(ws)
|
||||
clearInterval(pingInterval)
|
||||
})
|
||||
|
||||
ws.on('message', (rawData) => {
|
||||
|
||||
Reference in New Issue
Block a user