resilient-websocket
Advanced tools
A client WebSocket wrapper with support for reconnection and ping/pong
Weekly downloads
Readme
A client WebSocket wrapper with support for reconnection and ping/pong with a familiar API. Written in TypeScript
npm install resilient-websocket --save
import ResilientWebSocket, { WebSocketEvent } from 'resilient-websocket';
const opts = {
autoJsonify: true, // parse json message from server, stringify messages on send,
pingEnabled: true // send ping / pong messages
};
const rSock = new ResilientWebSocket(url, opts);
rSock.on(WebSocketEvent.CONNECTION, () => {
rSock.on(WebSocketEvent.MESSAGE, (message) => {
console.info('received message from the server', message);
rSock.send({ message: 'Right back at ya, buddy!' });
});
});
FAQs
A client WebSocket wrapper with support for reconnection and ping/pong
The npm package resilient-websocket receives a total of 717 weekly downloads. As such, resilient-websocket popularity was classified as not popular.
We found that resilient-websocket demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.