1.0.0 • Published 9 years ago

ws-heartbeats v1.0.0

Weekly downloads
8
License
ISC
Repository
-
Last release
9 years ago

ws-heartbeats

Ping / pong heartbeats for node ws.

Usage

require('ws-heartbeats')(websocketClient, [Optional] options)

Example

var sendHeartbeats = require('ws-heartbeats');

websocketServer.on('connection', function (websocketClient) {
    sendHeartbeats(websocketClient);
});

Options

An optional hash containing a subset of the following:

  • heartbeatTimeout - The period in which to deem a client dead in ms.
  • heartbeatInterval - The time between each ping to a client in ms.

Test

npm test