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

reconnecting-websocket

Package Overview
Dependencies
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

reconnecting-websocket - npm Package Compare versions

Comparing version 3.0.2 to 3.0.3

2

package.json
{
"name": "reconnecting-websocket",
"version": "3.0.2",
"version": "3.0.3",
"description": "Reconnecting WebSocket",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -13,3 +13,3 @@ # Reconnecting WebSocket

- Reassign event listeners when a new WebSocket instance is created
- Automatic reconnection using rfc6455 guidelines
- Automatic reconnection using [rfc6455](https://tools.ietf.org/html/rfc6455#section-7.2.3) guidelines
- Handle connection timeouts

@@ -85,3 +85,3 @@ - Full test coverage

const options = {connectionTimeout: 1000};
const ws = new WebSocket('ws://my.site.com', null, options);
const ws = new WebSocket('ws://my.site.com', [], options);
```

@@ -101,2 +101,13 @@

#### Setting WebSocket options
If you set any attributes of WebSocket itself, such as `binaryType`, make sure to set them again after each reconnection, i.e. on the `open` event:
```javascript
ws.addEventListener('open', () => {
ws.binaryType = 'arraybuffer';
ws.send('i am ready to receive some data!');
});
```
#### Using alternative constructor

@@ -103,0 +114,0 @@

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