websocket-heart-beat
v0.1.3
Published
Automatically reconnect the WebSocket if connection is closed.
Downloads
2
Readme
WebSocketHeartBeat
Automatically reconnect the WebSocket if connection is closed.
Install
npm i websocket-heart-beat
Usage
Simple usage
import WebSocketHeartBeat from 'websocket-heart-beat'
const ws = WebSocketHeartBeat(`ws://example.com`)
ws.addEventListener('open', () => {
ws.send('hey!')
})