Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ubergrape/websocket-buffering

Package Overview
Dependencies
Maintainers
3
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ubergrape/websocket-buffering

small wrapper around websocket that does message buffering and reconnects

  • 0.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
3
Weekly downloads
 
Created
Source

WebSocket-Buffering

small wrapper around websocket that does message buffering and reconnects

Build Status Coverage Status Dependency Status

This is heavily inspired by stagas/websocket for the client side, but does the same wrapping for ws in node as well, to provide the same api.

Buffers messages and sends them once the connection has been established. Also offers a .connect() method to re-establish a broken connection.

Installation

$ npm install websocket-buffering
$ component install Swatinem/websocket-buffering

Usage

new WebSocketBuffering(url, [options])

Creates a new WebSocket connection to url. If options.connect is set to false, it will not automatically connect If options.buffering is set to false, it will throw when sending on a closed socket instead of buffering and sending once the socket is open.

ws.readyState

This is the readyState as defined by WebSocket. ws.OPEN and so on.

ws.send(data)

Send data down the wire, or buffer it to be sent once the connection is actually open.

ws.connect()

This opens up a new connection when it is not open yet. Does nothing otherwise.

Event: 'open'

Event: 'error' (err)

Event: 'message' (message)

Event: 'close'

License

LGPLv3

Released as free software as part of ChatGrape

Keywords

FAQs

Package last updated on 10 Jun 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc