Skip to content

greenimpala/ws-heartbeats

master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 
 
 
 
 
 
 

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

About

ping / pong heartbeats for node ws

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published