mirror of
https://github.com/AlexandreRouma/wiscast.git
synced 2026-04-20 08:22:42 +00:00
add heartbeat to fix connection closing when idle
This commit is contained in:
@@ -74,6 +74,13 @@ class WisCastUserAPIClient {
|
||||
dispID: dispID,
|
||||
otp: OTP
|
||||
}))
|
||||
|
||||
// Send a heart-beat message every 30 seconds
|
||||
setInterval(async () => {
|
||||
await this.#sock.send(JSON.stringify({
|
||||
type: 'hb',
|
||||
}))
|
||||
}, 30000);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user