Exciting release!Introducing "safe npm". Learn more
Socket
Log inDemoInstall

resilient-websocket

Package Overview
Dependencies
0
Maintainers
1
Versions
10
Issues
File Explorer

Advanced tools

resilient-websocket

A client WebSocket wrapper with support for reconnection and ping/pong

    1.0.11latest
    npm

Version published
Maintainers
1
Weekly downloads
720
increased by10.6%

Weekly downloads

Readme

Source

resilient-websocket

A client WebSocket wrapper with support for reconnection and ping/pong with a familiar API. Written in TypeScript

Installing

npm install resilient-websocket --save

API

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

Last updated on 07 Jul 2019

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.

Install Socket
Socket
support@socket.devSocket SOC 2 Logo

Product

  • Package Issues
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc