Socket
Socket
Sign inDemoInstall

sockjs

Package Overview
Dependencies
99
Maintainers
5
Versions
36
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.3.14 to 0.3.15

2

lib/chunking-test.js

@@ -1,2 +0,2 @@

// Generated by CoffeeScript 1.8.0
// Generated by CoffeeScript 1.9.1
(function() {

@@ -3,0 +3,0 @@ var utils;

@@ -1,2 +0,2 @@

// Generated by CoffeeScript 1.8.0
// Generated by CoffeeScript 1.9.1
(function() {

@@ -3,0 +3,0 @@ var iframe_template, utils;

@@ -1,7 +0,7 @@

// Generated by CoffeeScript 1.8.0
// Generated by CoffeeScript 1.9.1
(function() {
var App, Listener, Server, chunking_test, events, fs, generate_dispatcher, iframe, sockjsVersion, trans_eventsource, trans_htmlfile, trans_jsonp, trans_websocket, trans_xhr, utils, webjs,
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
__bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty,
bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };

@@ -44,4 +44,4 @@ events = require('events');

App = (function(_super) {
__extends(App, _super);
App = (function(superClass) {
extend(App, superClass);

@@ -132,9 +132,9 @@ function App() {

Listener = (function() {
function Listener(options, emit) {
this.options = options;
this.handler = __bind(this.handler, this);
function Listener(options1, emit) {
this.options = options1;
this.handler = bind(this.handler, this);
this.app = new App();
this.app.options = options;
this.app.options = this.options;
this.app.emit = emit;
this.app.log('debug', 'SockJS v' + sockjsVersion() + ' ' + 'bound to ' + JSON.stringify(options.prefix));
this.app.log('debug', 'SockJS v' + sockjsVersion() + ' ' + 'bound to ' + JSON.stringify(this.options.prefix));
this.dispatcher = generate_dispatcher(this.options);

@@ -165,4 +165,4 @@ this.webjs_handler = webjs.generateHandler(this.app, this.dispatcher);

Server = (function(_super) {
__extends(Server, _super);
Server = (function(superClass) {
extend(Server, superClass);

@@ -169,0 +169,0 @@ function Server(user_options) {

@@ -1,6 +0,6 @@

// Generated by CoffeeScript 1.8.0
// Generated by CoffeeScript 1.9.1
(function() {
var EventSourceReceiver, transport, utils,
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;

@@ -11,4 +11,4 @@ utils = require('./utils');

EventSourceReceiver = (function(_super) {
__extends(EventSourceReceiver, _super);
EventSourceReceiver = (function(superClass) {
extend(EventSourceReceiver, superClass);

@@ -15,0 +15,0 @@ function EventSourceReceiver() {

@@ -1,6 +0,6 @@

// Generated by CoffeeScript 1.8.0
// Generated by CoffeeScript 1.9.1
(function() {
var HtmlFileReceiver, iframe_template, transport, utils,
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;

@@ -17,4 +17,4 @@ utils = require('./utils');

HtmlFileReceiver = (function(_super) {
__extends(HtmlFileReceiver, _super);
HtmlFileReceiver = (function(superClass) {
extend(HtmlFileReceiver, superClass);

@@ -21,0 +21,0 @@ function HtmlFileReceiver() {

@@ -1,11 +0,11 @@

// Generated by CoffeeScript 1.8.0
// Generated by CoffeeScript 1.9.1
(function() {
var JsonpReceiver, transport,
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;
transport = require('./transport');
JsonpReceiver = (function(_super) {
__extends(JsonpReceiver, _super);
JsonpReceiver = (function(superClass) {
extend(JsonpReceiver, superClass);

@@ -16,4 +16,4 @@ JsonpReceiver.prototype.protocol = "jsonp-polling";

function JsonpReceiver(req, res, options, callback) {
this.callback = callback;
function JsonpReceiver(req, res, options, callback1) {
this.callback = callback1;
JsonpReceiver.__super__.constructor.call(this, req, res, options);

@@ -53,3 +53,3 @@ }

jsonp_send: function(req, res, query) {
var d, jsonp, message, x, _i, _len;
var d, i, jsonp, len, message, x;
if (!query) {

@@ -97,4 +97,4 @@ throw {

}
for (_i = 0, _len = d.length; _i < _len; _i++) {
message = d[_i];
for (i = 0, len = d.length; i < len; i++) {
message = d[i];
jsonp.didMessage(message);

@@ -101,0 +101,0 @@ }

@@ -1,6 +0,6 @@

// Generated by CoffeeScript 1.8.0
// Generated by CoffeeScript 1.9.1
(function() {
var FayeWebsocket, RawWebsocketSessionReceiver, Transport, WebSocketReceiver, transport, utils,
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;

@@ -53,11 +53,11 @@ FayeWebsocket = require('faye-websocket');

WebSocketReceiver = (function(_super) {
__extends(WebSocketReceiver, _super);
WebSocketReceiver = (function(superClass) {
extend(WebSocketReceiver, superClass);
WebSocketReceiver.prototype.protocol = "websocket";
function WebSocketReceiver(ws, connection) {
function WebSocketReceiver(ws1, connection1) {
var x;
this.ws = ws;
this.connection = connection;
this.ws = ws1;
this.connection = connection1;
try {

@@ -88,3 +88,3 @@ this.connection.setKeepAlive(true, 5000);

WebSocketReceiver.prototype.didMessage = function(payload) {
var message, msg, x, _i, _len, _results;
var i, len, message, msg, results, x;
if (this.ws && this.session && payload.length > 0) {

@@ -98,8 +98,8 @@ try {

if (payload[0] === '[') {
_results = [];
for (_i = 0, _len = message.length; _i < _len; _i++) {
msg = message[_i];
_results.push(this.session.didMessage(msg));
results = [];
for (i = 0, len = message.length; i < len; i++) {
msg = message[i];
results.push(this.session.didMessage(msg));
}
return _results;
return results;
} else {

@@ -148,7 +148,7 @@ return this.session.didMessage(message);

RawWebsocketSessionReceiver = (function(_super) {
__extends(RawWebsocketSessionReceiver, _super);
RawWebsocketSessionReceiver = (function(superClass) {
extend(RawWebsocketSessionReceiver, superClass);
function RawWebsocketSessionReceiver(req, conn, server, ws) {
this.ws = ws;
function RawWebsocketSessionReceiver(req, conn, server, ws1) {
this.ws = ws1;
this.prefix = server.options.prefix;

@@ -155,0 +155,0 @@ this.readyState = Transport.OPEN;

@@ -1,6 +0,6 @@

// Generated by CoffeeScript 1.8.0
// Generated by CoffeeScript 1.9.1
(function() {
var XhrPollingReceiver, XhrStreamingReceiver, transport, utils,
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;

@@ -11,4 +11,4 @@ transport = require('./transport');

XhrStreamingReceiver = (function(_super) {
__extends(XhrStreamingReceiver, _super);
XhrStreamingReceiver = (function(superClass) {
extend(XhrStreamingReceiver, superClass);

@@ -29,4 +29,4 @@ function XhrStreamingReceiver() {

XhrPollingReceiver = (function(_super) {
__extends(XhrPollingReceiver, _super);
XhrPollingReceiver = (function(superClass) {
extend(XhrPollingReceiver, superClass);

@@ -53,3 +53,3 @@ function XhrPollingReceiver() {

xhr_send: function(req, res, data) {
var d, jsonp, message, x, _i, _len;
var d, i, jsonp, len, message, x;
if (!data) {

@@ -82,4 +82,4 @@ throw {

}
for (_i = 0, _len = d.length; _i < _len; _i++) {
message = d[_i];
for (i = 0, len = d.length; i < len; i++) {
message = d[i];
jsonp.didMessage(message);

@@ -86,0 +86,0 @@ }

@@ -1,6 +0,6 @@

// Generated by CoffeeScript 1.8.0
// Generated by CoffeeScript 1.9.1
(function() {
var GenericReceiver, MAP, ResponseReceiver, Session, SockJSConnection, Transport, closeFrame, register, stream, utils, uuid,
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;

@@ -32,4 +32,4 @@ stream = require('stream');

SockJSConnection = (function(_super) {
__extends(SockJSConnection, _super);
SockJSConnection = (function(superClass) {
extend(SockJSConnection, superClass);

@@ -91,4 +91,4 @@ function SockJSConnection(_session) {

Session = (function() {
function Session(session_id, server) {
this.session_id = session_id;
function Session(session_id1, server) {
this.session_id = session_id1;
this.heartbeat_delay = server.options.heartbeat_delay;

@@ -150,3 +150,3 @@ this.disconnect_delay = server.options.disconnect_delay;

Session.prototype.decorateConnection = function(req) {
var address, headers, key, remoteAddress, remotePort, socket, x, _i, _len, _ref;
var address, headers, i, key, len, ref, remoteAddress, remotePort, socket, x;
if (!(socket = this.recv.connection)) {

@@ -171,5 +171,5 @@ socket = this.recv.response.connection;

headers = {};
_ref = ['referer', 'x-client-ip', 'x-forwarded-for', 'x-cluster-client-ip', 'via', 'x-real-ip', 'host', 'user-agent', 'accept-language'];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
key = _ref[_i];
ref = ['referer', 'x-client-ip', 'x-forwarded-for', 'x-cluster-client-ip', 'via', 'x-real-ip', 'host', 'user-agent', 'accept-language'];
for (i = 0, len = ref.length; i < len; i++) {
key = ref[i];
if (req.headers[key]) {

@@ -200,5 +200,5 @@ headers[key] = req.headers[key];

Session.prototype.flushToRecv = function(recv) {
var sb, _ref;
var ref, sb;
if (this.send_buffer.length > 0) {
_ref = [this.send_buffer, []], sb = _ref[0], this.send_buffer = _ref[1];
ref = [this.send_buffer, []], sb = ref[0], this.send_buffer = ref[1];
recv.doSendBulk(sb);

@@ -358,9 +358,9 @@ return true;

q_msgs = (function() {
var _i, _len, _results;
_results = [];
for (_i = 0, _len = messages.length; _i < _len; _i++) {
m = messages[_i];
_results.push(utils.quote(m));
var i, len, results;
results = [];
for (i = 0, len = messages.length; i < len; i++) {
m = messages[i];
results.push(utils.quote(m));
}
return _results;
return results;
})();

@@ -374,4 +374,4 @@ return this.doSendFrame('a' + '[' + q_msgs.join(',') + ']');

ResponseReceiver = (function(_super) {
__extends(ResponseReceiver, _super);
ResponseReceiver = (function(superClass) {
extend(ResponseReceiver, superClass);

@@ -378,0 +378,0 @@ ResponseReceiver.prototype.max_response_size = void 0;

@@ -1,2 +0,2 @@

// Generated by CoffeeScript 1.8.0
// Generated by CoffeeScript 1.9.1
(function() {

@@ -8,6 +8,6 @@ var array_intersection, crypto, escapable, lookup, unroll_lookup;

exports.array_intersection = array_intersection = function(arr_a, arr_b) {
var a, r, _i, _len;
var a, j, len, r;
r = [];
for (_i = 0, _len = arr_a.length; _i < _len; _i++) {
a = arr_a[_i];
for (j = 0, len = arr_a.length; j < len; j++) {
a = arr_a[j];
if (arr_b.indexOf(a) !== -1) {

@@ -21,7 +21,7 @@ r.push(a);

exports.escape_selected = function(str, chars) {
var c, i, map, parts, r, v, _i, _j, _len, _ref;
var c, i, j, l, len, map, parts, r, ref, v;
map = {};
chars = '%' + chars;
for (_i = 0, _len = chars.length; _i < _len; _i++) {
c = chars[_i];
for (j = 0, len = chars.length; j < len; j++) {
c = chars[j];
map[c] = escape(c);

@@ -31,3 +31,3 @@ }

parts = str.split(r);
for (i = _j = 0, _ref = parts.length; 0 <= _ref ? _j < _ref : _j > _ref; i = 0 <= _ref ? ++_j : --_j) {
for (i = l = 0, ref = parts.length; 0 <= ref ? l < ref : l > ref; i = 0 <= ref ? ++l : --l) {
v = parts[i];

@@ -58,3 +58,3 @@ if (v.length === 1 && v in map) {

exports.timeout_chain = function(arr) {
var fun, timeout, user_fun, _ref;
var fun, ref, timeout, user_fun;
arr = arr.slice(0);

@@ -64,3 +64,3 @@ if (!arr.length) {

}
_ref = arr.shift(), timeout = _ref[0], user_fun = _ref[1];
ref = arr.shift(), timeout = ref[0], user_fun = ref[1];
fun = (function(_this) {

@@ -90,6 +90,6 @@ return function() {

new_handler = function() {
var listener, _i, _len;
var j, len, listener;
if (handler.apply(this, arguments) !== true) {
for (_i = 0, _len = old_listeners.length; _i < _len; _i++) {
listener = old_listeners[_i];
for (j = 0, len = old_listeners.length; j < len; j++) {
listener = old_listeners[j];
listener.apply(this, arguments);

@@ -110,8 +110,8 @@ }

c = (function() {
var _i, _results;
_results = [];
for (i = _i = 0; _i < 65536; i = ++_i) {
_results.push(String.fromCharCode(i));
var j, results;
results = [];
for (i = j = 0; j < 65536; i = ++j) {
results.push(String.fromCharCode(i));
}
return _results;
return results;
})();

@@ -140,8 +140,8 @@ escapable.lastIndex = 0;

exports.parseCookie = function(cookie_header) {
var cookie, cookies, parts, _i, _len, _ref;
var cookie, cookies, j, len, parts, ref;
cookies = {};
if (cookie_header) {
_ref = cookie_header.split(';');
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
cookie = _ref[_i];
ref = cookie_header.split(';');
for (j = 0, len = ref.length; j < len; j++) {
cookie = ref[j];
parts = cookie.split('=');

@@ -148,0 +148,0 @@ cookies[parts[0].trim()] = (parts[1] || '').trim();

@@ -1,2 +0,2 @@

// Generated by CoffeeScript 1.8.0
// Generated by CoffeeScript 1.9.1
(function() {

@@ -16,11 +16,11 @@ var GenericApp, execute_request, fake_response, fs, http, querystring, url, utils;

execute_request = function(app, funs, req, res, data) {
var fun, x, _results;
var fun, results, x;
try {
_results = [];
results = [];
while (funs.length > 0) {
fun = funs.shift();
req.last_fun = fun;
_results.push(data = app[fun](req, res, data, req.next_filter));
results.push(data = app[fun](req, res, data, req.next_filter));
}
return _results;
return results;
} catch (_error) {

@@ -78,3 +78,3 @@ x = _error;

return function(req, res, head) {
var allowed_methods, found, funs, i, m, method, path, row, _i, _j, _len, _ref;
var allowed_methods, found, funs, i, j, l, len, m, method, path, ref, row;
if (typeof res.writeHead === "undefined") {

@@ -87,4 +87,4 @@ fake_response(req, res);

allowed_methods = [];
for (_i = 0, _len = dispatcher.length; _i < _len; _i++) {
row = dispatcher[_i];
for (j = 0, len = dispatcher.length; j < len; j++) {
row = dispatcher[j];
method = row[0], path = row[1], funs = row[2];

@@ -102,3 +102,3 @@ if (path.constructor !== Array) {

}
for (i = _j = 1, _ref = path.length; 1 <= _ref ? _j < _ref : _j > _ref; i = 1 <= _ref ? ++_j : --_j) {
for (i = l = 1, ref = path.length; 1 <= ref ? l < ref : l > ref; i = 1 <= ref ? ++l : --l) {
req[path[i]] = m[i];

@@ -105,0 +105,0 @@ }

{
"name": "sockjs",
"description": "SockJS-node is a server counterpart of SockJS-client a JavaScript library that provides a WebSocket-like object in the browser. SockJS gives you a coherent, cross-browser, Javascript API which creates a low latency, full duplex, cross-domain communication channel between the browser and the web server.",
"version": "0.3.14",
"version": "0.3.15",
"author": "Marek Majkowski",

@@ -6,0 +6,0 @@ "bugs": {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc