forked from Archives/Athou_commafeed
increase websocket ping interval to just under a minute instead of the default 15s
This commit is contained in:
@@ -12,7 +12,12 @@ export const useWebSocket = () => {
|
||||
const wsProtocol = currentUrl.protocol === "http:" ? "ws" : "wss"
|
||||
const wsUrl = `${wsProtocol}://${currentUrl.hostname}:${currentUrl.port}/ws`
|
||||
|
||||
const ws = new WebsocketHeartbeatJs({ url: wsUrl, pingMsg: "ping" })
|
||||
const ws = new WebsocketHeartbeatJs({
|
||||
url: wsUrl,
|
||||
pingMsg: "ping",
|
||||
// ping interval, just under a minute to prevent firewalls from closing idle connections
|
||||
pingTimeout: 55000,
|
||||
})
|
||||
ws.onopen = () => dispatch(setWebSocketConnected(true))
|
||||
ws.onclose = () => dispatch(setWebSocketConnected(false))
|
||||
ws.onmessage = event => {
|
||||
|
||||
Reference in New Issue
Block a user