Sha256: bd9448f79155c38e8f3d1a070dab8977bc86c8f2ba2091a17ce9ad01ecd428f7

Contents?: true

Size: 831 Bytes

Versions: 193

Compression:

Stored size: 831 Bytes

Contents

/**
 * 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;

Version data entries

193 entries across 105 versions & 4 rubygems

Version Path
flok-0.0.99 spec/iface/driver/assets/node_modules/socket.io/node_modules/engine.io/node_modules/ws/lib/browser.js
flok-0.0.99 spec/iface/driver/assets/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/lib/browser.js
flok-0.0.98 spec/iface/driver/assets/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/lib/browser.js
flok-0.0.98 spec/iface/driver/assets/node_modules/socket.io/node_modules/engine.io/node_modules/ws/lib/browser.js
flok-0.0.97 spec/iface/driver/assets/node_modules/socket.io/node_modules/engine.io/node_modules/ws/lib/browser.js
flok-0.0.97 spec/iface/driver/assets/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/lib/browser.js
flok-0.0.96 spec/iface/driver/assets/node_modules/socket.io/node_modules/engine.io/node_modules/ws/lib/browser.js
flok-0.0.96 spec/iface/driver/assets/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/lib/browser.js
flok-0.0.95 spec/iface/driver/assets/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/lib/browser.js
flok-0.0.95 spec/iface/driver/assets/node_modules/socket.io/node_modules/engine.io/node_modules/ws/lib/browser.js
flok-0.0.94 spec/iface/driver/assets/node_modules/socket.io/node_modules/engine.io/node_modules/ws/lib/browser.js
flok-0.0.94 spec/iface/driver/assets/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/lib/browser.js
flok-0.0.93 spec/iface/driver/assets/node_modules/socket.io/node_modules/engine.io/node_modules/ws/lib/browser.js
flok-0.0.93 spec/iface/driver/assets/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/lib/browser.js
flok-0.0.92 spec/iface/driver/assets/node_modules/socket.io/node_modules/engine.io/node_modules/ws/lib/browser.js
flok-0.0.92 spec/iface/driver/assets/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/lib/browser.js
flok-0.0.91 spec/iface/driver/assets/node_modules/socket.io/node_modules/engine.io/node_modules/ws/lib/browser.js
flok-0.0.91 spec/iface/driver/assets/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/lib/browser.js
flok-0.0.90 spec/iface/driver/assets/node_modules/socket.io/node_modules/engine.io/node_modules/ws/lib/browser.js
flok-0.0.90 spec/iface/driver/assets/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/lib/browser.js