How to use the websocket-driver.client function in websocket-driver

To help you get started, we’ve selected a few websocket-driver examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jonniespratley / jps-passbook-manager / node_modules / grunt-contrib-livereload / node_modules / tiny-lr / node_modules / faye-websocket / lib / faye / websocket / client.js View on Github external
var Client = function(url, protocols, options) {
  options = options || {};

  this.url     = url;
  this._uri    = require('url').parse(url);
  this._driver = driver.client(url, {maxLength: options.maxLength, protocols: protocols});

  ['open', 'error'].forEach(function(event) {
    this._driver.on(event, function() {
      self.headers    = self._driver.headers;
      self.statusCode = self._driver.statusCode;
    });
  }, this);

  var secure     = (this._uri.protocol === 'wss:'),
      onConnect  = function() { self._driver.start() },
      tlsOptions = {},
      self       = this;

  if (options.ca) tlsOptions.ca = options.ca;

  var connection = secure
github ethereum / meteor-dapp-whisper-chat-client / dist / bundle / programs / server / npm / ddp / node_modules / faye-websocket / lib / faye / websocket / client.js View on Github external
var Client = function(_url, protocols, options) {
  options = options || {};

  this.url     = _url;
  this._driver = driver.client(this.url, {maxLength: options.maxLength, protocols: protocols});

  ['open', 'error'].forEach(function(event) {
    this._driver.on(event, function() {
      self.headers    = self._driver.headers;
      self.statusCode = self._driver.statusCode;
    });
  }, this);

  var proxy     = options.proxy || {},
      endpoint  = url.parse(proxy.origin || this.url),
      port      = endpoint.port || DEFAULT_PORTS[endpoint.protocol],
      secure    = SECURE_PROTOCOLS.indexOf(endpoint.protocol) >= 0,
      onConnect = function() { self._onConnect() },
      originTLS = options.tls || {},
      socketTLS = proxy.origin ? (proxy.tls || {}) : originTLS,
      self      = this;
github carlosazaustre / react-firebase-t3chfest / node_modules / faye-websocket / lib / faye / websocket / client.js View on Github external
var Client = function(_url, protocols, options) {
  options = options || {};

  this.url     = _url;
  this._driver = driver.client(this.url, {maxLength: options.maxLength, protocols: protocols});

  ['open', 'error'].forEach(function(event) {
    this._driver.on(event, function() {
      self.headers    = self._driver.headers;
      self.statusCode = self._driver.statusCode;
    });
  }, this);

  var proxy     = options.proxy || {},
      endpoint  = url.parse(proxy.origin || this.url),
      port      = endpoint.port || DEFAULT_PORTS[endpoint.protocol],
      secure    = SECURE_PROTOCOLS.indexOf(endpoint.protocol) >= 0,
      onConnect = function() { self._onConnect() },
      originTLS = options.tls || {},
      socketTLS = proxy.origin ? (proxy.tls || {}) : originTLS,
      self      = this;
github MuYunyun / reactSPA / node_modules / sockjs-client / node_modules / faye-websocket / lib / faye / websocket / client.js View on Github external
var Client = function(url, protocols, options) {
  options = options || {};

  this.url     = url;
  this._uri    = require('url').parse(url);
  this._driver = driver.client(url, {maxLength: options.maxLength, protocols: protocols});

  ['open', 'error'].forEach(function(event) {
    this._driver.on(event, function() {
      self.headers    = self._driver.headers;
      self.statusCode = self._driver.statusCode;
    });
  }, this);

  var secure     = (this._uri.protocol === 'wss:'),
      onConnect  = function() { self._driver.start() },
      tlsOptions = {},
      self       = this;

  if (options.ca) tlsOptions.ca = options.ca;

  var connection = secure
github sx1989827 / DOClever / Desktop / node_modules / sockjs-client / node_modules / faye-websocket / lib / faye / websocket / client.js View on Github external
var Client = function(_url, protocols, options) {
  options = options || {};

  this.url     = _url;
  this._driver = driver.client(this.url, {maxLength: options.maxLength, protocols: protocols});

  ['open', 'error'].forEach(function(event) {
    this._driver.on(event, function() {
      self.headers    = self._driver.headers;
      self.statusCode = self._driver.statusCode;
    });
  }, this);

  var proxy      = options.proxy || {},
      endpoint   = url.parse(proxy.origin || this.url),
      port       = endpoint.port || DEFAULT_PORTS[endpoint.protocol],
      secure     = SECURE_PROTOCOLS.indexOf(endpoint.protocol) >= 0,
      onConnect  = function() { self._onConnect() },
      netOptions = options.net || {},
      originTLS  = options.tls || {},
      socketTLS  = proxy.origin ? (proxy.tls || {}) : originTLS,
github faye / faye-websocket-node / lib / faye / websocket / client.js View on Github external
var Client = function(_url, protocols, options) {
  options = options || {};

  this.url     = _url;
  this._driver = driver.client(this.url, { maxLength: options.maxLength, protocols: protocols });

  ['open', 'error'].forEach(function(event) {
    this._driver.on(event, function() {
      self.headers    = self._driver.headers;
      self.statusCode = self._driver.statusCode;
    });
  }, this);

  var proxy      = options.proxy || {},
      endpoint   = url.parse(proxy.origin || this.url),
      port       = endpoint.port || DEFAULT_PORTS[endpoint.protocol],
      secure     = SECURE_PROTOCOLS.indexOf(endpoint.protocol) >= 0,
      onConnect  = function() { self._onConnect() },
      netOptions = options.net || {},
      originTLS  = options.tls || {},
      socketTLS  = proxy.origin ? (proxy.tls || {}) : originTLS,
github ridhwaans / homehost / client / node_modules / faye-websocket / lib / faye / websocket / client.js View on Github external
var Client = function(_url, protocols, options) {
  options = options || {};

  this.url     = _url;
  this._driver = driver.client(this.url, {maxLength: options.maxLength, protocols: protocols});

  ['open', 'error'].forEach(function(event) {
    this._driver.on(event, function() {
      self.headers    = self._driver.headers;
      self.statusCode = self._driver.statusCode;
    });
  }, this);

  var proxy     = options.proxy || {},
      endpoint  = url.parse(proxy.origin || this.url),
      port      = endpoint.port || DEFAULT_PORTS[endpoint.protocol],
      secure    = SECURE_PROTOCOLS.indexOf(endpoint.protocol) >= 0,
      onConnect = function() { self._onConnect() },
      originTLS = options.tls || {},
      socketTLS = proxy.origin ? (proxy.tls || {}) : originTLS,
      self      = this;
github sx1989827 / DOClever / Desktop / node_modules / faye-websocket / lib / faye / websocket / client.js View on Github external
var Client = function(_url, protocols, options) {
  options = options || {};

  this.url     = _url;
  this._driver = driver.client(this.url, {maxLength: options.maxLength, protocols: protocols});

  ['open', 'error'].forEach(function(event) {
    this._driver.on(event, function() {
      self.headers    = self._driver.headers;
      self.statusCode = self._driver.statusCode;
    });
  }, this);

  var proxy     = options.proxy || {},
      endpoint  = url.parse(proxy.origin || this.url),
      port      = endpoint.port || DEFAULT_PORTS[endpoint.protocol],
      secure    = SECURE_PROTOCOLS.indexOf(endpoint.protocol) >= 0,
      onConnect = function() { self._onConnect() },
      originTLS = options.tls || {},
      socketTLS = proxy.origin ? (proxy.tls || {}) : originTLS,
      self      = this;
github modjs / mod / node_modules / faye-websocket / lib / faye / websocket / client.js View on Github external
var Client = function(url, protocols, options) {
  this.url     = url;
  this._uri    = require('url').parse(url);
  this._driver = driver.client(url, {protocols: protocols});

  ['open', 'error'].forEach(function(event) {
    this._driver.on(event, function() {
      self.headers    = self._driver.headers;
      self.statusCode = self._driver.statusCode;
    });
  }, this);

  var secure     = (this._uri.protocol === 'wss:'),
      onConnect  = function() { self._driver.start() },
      tlsOptions = {},
      self       = this;

  if (options && options.verify === false) tlsOptions.rejectUnauthorized = false;

  var connection = secure

websocket-driver

WebSocket protocol handler with pluggable I/O

Apache-2.0
Latest version published 4 years ago

Package Health Score

70 / 100
Full package analysis