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

ws

Package Overview
Dependencies
Maintainers
3
Versions
169
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ws - npm Package Compare versions

Comparing version 0.8.0 to 0.8.1

21

lib/PerMessageDeflate.js

@@ -72,2 +72,19 @@

/**
* Releases all resources used by the extension
*
* @api public
*/
PerMessageDeflate.prototype.cleanup = function() {
if (this._inflate) {
this._inflate.close();
this._inflate = null;
}
if (this._deflate) {
this._deflate.close();
this._deflate = null;
}
};
/**
* Accept extension offer from client

@@ -235,5 +252,7 @@ *

function cleanup() {
if (!self._inflate) return;
self._inflate.removeListener('error', onError);
self._inflate.removeListener('data', onData);
if (fin && self.params[endpoint + '_no_context_takeover']) {
self._inflate.close();
self._inflate = null;

@@ -286,5 +305,7 @@ }

function cleanup() {
if (!self._deflate) return;
self._deflate.removeListener('error', onError);
self._deflate.removeListener('data', onData);
if (fin && self.params[endpoint + '_no_context_takeover']) {
self._deflate.close();
self._deflate = null;

@@ -291,0 +312,0 @@ }

2

lib/Receiver.js

@@ -248,3 +248,3 @@ /*!

if (!this.state.fragmentedOperation) this.unfragmentedBufferPool.reset(true);
else if (this.state.lastFragment) this.fragmentedBufferPool.reset(false);
else if (this.state.lastFragment) this.fragmentedBufferPool.reset(true);
this.expectOffset = 0;

@@ -251,0 +251,0 @@ this.expectBuffer = null;

@@ -48,3 +48,3 @@ 'use strict';

if (this instanceof WebSocket === false) {
throw new TypeError("Classes can't be function-called");
return new WebSocket(address, protocols, options);
}

@@ -956,2 +956,8 @@

if (this.extensions[PerMessageDeflate.extensionName]) {
this.extensions[PerMessageDeflate.extensionName].cleanup();
}
this.extensions = null;
this.removeAllListeners();

@@ -958,0 +964,0 @@ this.on('error', function onerror() {}); // catch all errors after this

@@ -24,3 +24,3 @@ /*!

if (this instanceof WebSocketServer === false) {
throw new TypeError("Classes can't be function-called");
return new WebSocketServer(options, callback);
}

@@ -111,3 +111,3 @@

WebSocketServer.prototype.close = function() {
WebSocketServer.prototype.close = function(callback) {
// terminate all associated clients

@@ -141,3 +141,6 @@ var error = null;

}
if (error) throw error;
if(callback)
callback(error);
else if(error)
throw error;
}

@@ -144,0 +147,0 @@

@@ -5,3 +5,3 @@ {

"description": "simple to use, blazing fast and thoroughly tested websocket client, server and console for node.js, up-to-date against RFC-6455",
"version": "0.8.0",
"version": "0.8.1",
"license": "MIT",

@@ -8,0 +8,0 @@ "keywords": [

Sorry, the diff of this file is not supported yet

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