Comment on page
Keep connection alive
You can enable auto reconnection with the option "reconnect".
const options = { reconnect: true };
const client = new obyte.Client('wss://obyte.org/bb', options);
Another way to keep the connection with the WebSocket node alive is to notify the node that your peer is awake every 10 sec.
setInterval(function() {
client.api.heartbeat()
}, 10 * 1000);
Last modified 3yr ago