Keep connection alive

Reconnect

You can enable auto reconnection with the option "reconnect".
1
const options = { reconnect: true };
2
const client = new obyte.Client('wss://obyte.org/bb', options);
Copied!

Notify

Another way to keep the connection with the WebSocket node alive is to notify the node that your peer is awake every 10 sec.
1
setInterval(function() {
2
client.api.heartbeat()
3
}, 10 * 1000);
Copied!
Last modified 1yr ago
Copy link