How to use the websocket-driver.http 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 faye / faye-websocket-node / lib / faye / websocket.js View on Github external
var WebSocket = function(request, socket, body, protocols, options) {
  options = options || {};

  this._stream = socket;
  this._driver = driver.http(request, { maxLength: options.maxLength, protocols: protocols });

  var self = this;
  if (!this._stream || !this._stream.writable) return;
  if (!this._stream.readable) return this._stream.end();

  var catchup = function() { self._stream.removeListener('data', catchup) };
  this._stream.on('data', catchup);

  API.call(this, options);

  process.nextTick(function() {
    self._driver.start();
    self._driver.io.write(body);
  });
};
util.inherits(WebSocket, API);
github Lapple / ErrorBoard / node_modules / sockjs / node_modules / faye-websocket / lib / faye / websocket.js View on Github external
var WebSocket = function(request, socket, body, protocols, options) {
  options = options || {};

  this._stream = socket;
  this._driver = driver.http(request, {maxLength: options.maxLength, protocols: protocols});

  var self = this;
  if (!this._stream || !this._stream.writable) return;
  if (!this._stream.readable) return this._stream.end();

  var catchup = function() { self._stream.removeListener('data', catchup) };
  this._stream.on('data', catchup);

  this._driver.io.write(body);
  API.call(this, options);

  process.nextTick(function() {
    self._driver.start();
  });
};
util.inherits(WebSocket, API);
github carlosazaustre / react-firebase-t3chfest / node_modules / faye-websocket / lib / faye / websocket.js View on Github external
var WebSocket = function(request, socket, body, protocols, options) {
  options = options || {};

  this._stream = socket;
  this._driver = driver.http(request, {maxLength: options.maxLength, protocols: protocols});

  var self = this;
  if (!this._stream || !this._stream.writable) return;
  if (!this._stream.readable) return this._stream.end();

  var catchup = function() { self._stream.removeListener('data', catchup) };
  this._stream.on('data', catchup);

  this._driver.io.write(body);
  API.call(this, options);

  process.nextTick(function() {
    self._driver.start();
  });
};
util.inherits(WebSocket, API);
github makuga01 / dnsFookup / FE / node_modules / faye-websocket / lib / faye / websocket.js View on Github external
var WebSocket = function(request, socket, body, protocols, options) {
  options = options || {};

  this._stream = socket;
  this._driver = driver.http(request, {maxLength: options.maxLength, protocols: protocols});

  var self = this;
  if (!this._stream || !this._stream.writable) return;
  if (!this._stream.readable) return this._stream.end();

  var catchup = function() { self._stream.removeListener('data', catchup) };
  this._stream.on('data', catchup);

  API.call(this, options);

  process.nextTick(function() {
    self._driver.start();
    self._driver.io.write(body);
  });
};
util.inherits(WebSocket, API);

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