Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
* by C. Scott Ananian 2014-08-26
*
* Based on https://gist.github.com/toshirot/1428579
*/
var events = require("events");
var util = require("util");
var WebSocketRequest = require('websocket').request;
var WebSocketServer = require('websocket').server;
// Copy helpers from WebSocketServer to WebSocketRequest
WebSocketRequest.prototype.connections = [];
WebSocketRequest.prototype.handleRequestAccepted =
WebSocketServer.prototype.handleRequestAccepted;
WebSocketRequest.prototype.handleConnectionClose =
WebSocketServer.prototype.handleConnectionClose;
WebSocketRequest.prototype.broadcastUTF =
WebSocketServer.prototype.broadcastUTF;
var miksagoServerFactory = require('websocket-server');
var miksagoConnection = require('./node_modules/websocket-server/lib/ws/connection');
var CompatWebSocketServer = function(options) {
events.EventEmitter.call(this); // superclass constructor
var self = this;
var handleConnection;
// node-websocket-server (hixie-75 and hixie-76 support)
var miksagoServer = miksagoServerFactory.createServer();
miksagoServer.server = options.httpServer;
miksagoServer.addListener('connection', function(connection) {
* Based on https://gist.github.com/toshirot/1428579
*/
var events = require("events");
var util = require("util");
var WebSocketRequest = require('websocket').request;
var WebSocketServer = require('websocket').server;
// Copy helpers from WebSocketServer to WebSocketRequest
WebSocketRequest.prototype.connections = [];
WebSocketRequest.prototype.handleRequestAccepted =
WebSocketServer.prototype.handleRequestAccepted;
WebSocketRequest.prototype.handleConnectionClose =
WebSocketServer.prototype.handleConnectionClose;
WebSocketRequest.prototype.broadcastUTF =
WebSocketServer.prototype.broadcastUTF;
var miksagoServerFactory = require('websocket-server');
var miksagoConnection = require('./node_modules/websocket-server/lib/ws/connection');
var CompatWebSocketServer = function(options) {
events.EventEmitter.call(this); // superclass constructor
var self = this;
var handleConnection;
// node-websocket-server (hixie-75 and hixie-76 support)
var miksagoServer = miksagoServerFactory.createServer();
miksagoServer.server = options.httpServer;
miksagoServer.addListener('connection', function(connection) {
// Add remoteAddress property
connection.remoteAddress = connection._socket.remoteAddress;
*
* This file released into the public domain
* by C. Scott Ananian 2014-08-26
*
* Based on https://gist.github.com/toshirot/1428579
*/
var events = require("events");
var util = require("util");
var WebSocketRequest = require('websocket').request;
var WebSocketServer = require('websocket').server;
// Copy helpers from WebSocketServer to WebSocketRequest
WebSocketRequest.prototype.connections = [];
WebSocketRequest.prototype.handleRequestAccepted =
WebSocketServer.prototype.handleRequestAccepted;
WebSocketRequest.prototype.handleConnectionClose =
WebSocketServer.prototype.handleConnectionClose;
WebSocketRequest.prototype.broadcastUTF =
WebSocketServer.prototype.broadcastUTF;
var miksagoServerFactory = require('websocket-server');
var miksagoConnection = require('./node_modules/websocket-server/lib/ws/connection');
var CompatWebSocketServer = function(options) {
events.EventEmitter.call(this); // superclass constructor
var self = this;
var handleConnection;
// node-websocket-server (hixie-75 and hixie-76 support)
var miksagoServer = miksagoServerFactory.createServer();
* presumably, very old browsers).
*
* This file released into the public domain
* by C. Scott Ananian 2014-08-26
*
* Based on https://gist.github.com/toshirot/1428579
*/
var events = require("events");
var util = require("util");
var WebSocketRequest = require('websocket').request;
var WebSocketServer = require('websocket').server;
// Copy helpers from WebSocketServer to WebSocketRequest
WebSocketRequest.prototype.connections = [];
WebSocketRequest.prototype.handleRequestAccepted =
WebSocketServer.prototype.handleRequestAccepted;
WebSocketRequest.prototype.handleConnectionClose =
WebSocketServer.prototype.handleConnectionClose;
WebSocketRequest.prototype.broadcastUTF =
WebSocketServer.prototype.broadcastUTF;
var miksagoServerFactory = require('websocket-server');
var miksagoConnection = require('./node_modules/websocket-server/lib/ws/connection');
var CompatWebSocketServer = function(options) {
events.EventEmitter.call(this); // superclass constructor
var self = this;
var handleConnection;
// node-websocket-server (hixie-75 and hixie-76 support)