Socket
Socket
Sign inDemoInstall

ws

Package Overview
Dependencies
Maintainers
2
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.4.30 to 0.4.31

13

History.md

@@ -0,1 +1,14 @@

v0.4.31 - September 23th, 2013
=====================
* Component support
v0.4.30 - August 30th, 2013
=====================
* BufferedAmount could be undefined, default to 0 [TooTallNate]
* Support protocols as second argument and options as third [TooTallNate]
* Proper browserify shim [mcollina]
* Broadcasting example in README [stefanocudini]
v0.4.29 - August 23th, 2013

@@ -2,0 +15,0 @@ =====================

44

lib/browser.js

@@ -1,3 +0,43 @@

/// shim for browser packaging
module.exports = global.WebSocket || global.MozWebSocket;
/**
* Module dependencies.
*/
var global = (function() { return this; })();
/**
* WebSocket constructor.
*/
var WebSocket = global.WebSocket || global.MozWebSocket;
/**
* Module exports.
*/
module.exports = WebSocket ? ws : null;
/**
* WebSocket constructor.
*
* The third `opts` options object gets ignored in web browsers, since it's
* non-standard, and throws a TypeError if passed to the constructor.
* See: https://github.com/einaros/ws/issues/227
*
* @param {String} uri
* @param {Array} protocols (optional)
* @param {Object) opts (optional)
* @api public
*/
function ws(uri, protocols, opts) {
var instance;
if (protocols) {
instance = new WebSocket(uri, protocols);
} else {
instance = new WebSocket(uri);
}
return instance;
}
if (WebSocket) ws.prototype = WebSocket.prototype;

@@ -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.4.30",
"version": "0.4.31",
"keywords": [

@@ -44,3 +44,8 @@ "Hixie",

"browser": "./lib/browser.js",
"component": {
"scripts": {
"ws/index.js": "./lib/browser.js"
}
},
"gypfile": true
}
builderror.log
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