Skip to content
ping / pong heartbeats for node ws
JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
test
.gitignore
README.md
index.js
package.json

README.md

ws-heartbeats

Ping / pong heartbeats for node ws.

Usage

npm install ws-heartbeats
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

You can’t perform that action at this time.