sockjs
Advanced tools
Comparing version 0.3.15 to 0.3.16
@@ -6,3 +6,3 @@ var http = require('http'); | ||
// 1. Echo sockjs server | ||
var sockjs_opts = {sockjs_url: "http://cdn.jsdelivr.net/sockjs/0.3.4/sockjs.min.js"}; | ||
var sockjs_opts = {sockjs_url: "http://cdn.jsdelivr.net/sockjs/1.0.1/sockjs.min.js"}; | ||
@@ -9,0 +9,0 @@ var sockjs_echo = sockjs.createServer(sockjs_opts); |
@@ -6,3 +6,3 @@ var express = require('express'); | ||
// 1. Echo sockjs server | ||
var sockjs_opts = {sockjs_url: "http://cdn.jsdelivr.net/sockjs/0.3.4/sockjs.min.js"}; | ||
var sockjs_opts = {sockjs_url: "http://cdn.jsdelivr.net/sockjs/1.0.1/sockjs.min.js"}; | ||
@@ -9,0 +9,0 @@ var sockjs_echo = sockjs.createServer(sockjs_opts); |
@@ -5,3 +5,3 @@ var express = require('express'); | ||
// 1. Echo sockjs server | ||
var sockjs_opts = {sockjs_url: "http://cdn.jsdelivr.net/sockjs/0.3.4/sockjs.min.js"}; | ||
var sockjs_opts = {sockjs_url: "http://cdn.jsdelivr.net/sockjs/1.0.1/sockjs.min.js"}; | ||
@@ -8,0 +8,0 @@ var sockjs_echo = sockjs.createServer(sockjs_opts); |
@@ -9,3 +9,3 @@ /** | ||
// 1. Echo sockjs server | ||
var sockjs_opts = {sockjs_url: "http://cdn.jsdelivr.net/sockjs/0.3.4/sockjs.min.js"}; | ||
var sockjs_opts = {sockjs_url: "http://cdn.jsdelivr.net/sockjs/1.0.1/sockjs.min.js"}; | ||
@@ -12,0 +12,0 @@ var sockjs_echo = sockjs.createServer(sockjs_opts); |
@@ -8,3 +8,3 @@ var express = require('express'); | ||
// 1. Setup SockJS server | ||
var sockjs_opts = {sockjs_url: "http://cdn.jsdelivr.net/sockjs/0.3.4/sockjs.min.js"}; | ||
var sockjs_opts = {sockjs_url: "http://cdn.jsdelivr.net/sockjs/1.0.1/sockjs.min.js"}; | ||
var service = sockjs.createServer(sockjs_opts); | ||
@@ -11,0 +11,0 @@ |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.9.1 | ||
// Generated by CoffeeScript 1.9.3 | ||
(function() { | ||
@@ -3,0 +3,0 @@ var utils; |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.9.1 | ||
// Generated by CoffeeScript 1.9.3 | ||
(function() { | ||
@@ -3,0 +3,0 @@ var iframe_template, utils; |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.9.1 | ||
// Generated by CoffeeScript 1.9.3 | ||
(function() { | ||
@@ -104,3 +104,3 @@ var App, Listener, Server, chunking_test, events, fs, generate_dispatcher, iframe, sockjsVersion, trans_eventsource, trans_htmlfile, trans_jsonp, trans_websocket, trans_xhr, utils, webjs, | ||
generate_dispatcher = function(options) { | ||
var dispatcher, opts_filters, p, t; | ||
var opts_filters, p, prefix_dispatcher, t, transport_dispatcher; | ||
p = (function(_this) { | ||
@@ -122,9 +122,12 @@ return function(s) { | ||
}; | ||
dispatcher = [['GET', p(''), ['welcome_screen']], ['GET', p('/iframe[0-9-.a-z_]*.html'), ['iframe', 'cache_for', 'expose']], ['OPTIONS', p('/info'), opts_filters('info_options')], ['GET', p('/info'), ['xhr_cors', 'h_no_cache', 'info', 'expose']], ['OPTIONS', p('/chunking_test'), opts_filters()], ['POST', p('/chunking_test'), ['xhr_cors', 'expect_xhr', 'chunking_test']], ['GET', p('/websocket'), ['raw_websocket']], ['GET', t('/jsonp'), ['h_sid', 'h_no_cache', 'jsonp']], ['POST', t('/jsonp_send'), ['h_sid', 'h_no_cache', 'expect_form', 'jsonp_send']], ['POST', t('/xhr'), ['h_sid', 'h_no_cache', 'xhr_cors', 'xhr_poll']], ['OPTIONS', t('/xhr'), opts_filters()], ['POST', t('/xhr_send'), ['h_sid', 'h_no_cache', 'xhr_cors', 'expect_xhr', 'xhr_send']], ['OPTIONS', t('/xhr_send'), opts_filters()], ['POST', t('/xhr_streaming'), ['h_sid', 'h_no_cache', 'xhr_cors', 'xhr_streaming']], ['OPTIONS', t('/xhr_streaming'), opts_filters()], ['GET', t('/eventsource'), ['h_sid', 'h_no_cache', 'eventsource']], ['GET', t('/htmlfile'), ['h_sid', 'h_no_cache', 'htmlfile']]]; | ||
prefix_dispatcher = [['GET', p(''), ['welcome_screen']], ['GET', p('/iframe[0-9-.a-z_]*.html'), ['iframe', 'cache_for', 'expose']], ['OPTIONS', p('/info'), opts_filters('info_options')], ['GET', p('/info'), ['xhr_cors', 'h_no_cache', 'info', 'expose']], ['OPTIONS', p('/chunking_test'), opts_filters()], ['POST', p('/chunking_test'), ['xhr_cors', 'expect_xhr', 'chunking_test']]]; | ||
transport_dispatcher = [['GET', t('/jsonp'), ['h_sid', 'h_no_cache', 'jsonp']], ['POST', t('/jsonp_send'), ['h_sid', 'h_no_cache', 'expect_form', 'jsonp_send']], ['POST', t('/xhr'), ['h_sid', 'h_no_cache', 'xhr_cors', 'xhr_poll']], ['OPTIONS', t('/xhr'), opts_filters()], ['POST', t('/xhr_send'), ['h_sid', 'h_no_cache', 'xhr_cors', 'expect_xhr', 'xhr_send']], ['OPTIONS', t('/xhr_send'), opts_filters()], ['POST', t('/xhr_streaming'), ['h_sid', 'h_no_cache', 'xhr_cors', 'xhr_streaming']], ['OPTIONS', t('/xhr_streaming'), opts_filters()], ['GET', t('/eventsource'), ['h_sid', 'h_no_cache', 'eventsource']], ['GET', t('/htmlfile'), ['h_sid', 'h_no_cache', 'htmlfile']]]; | ||
if (options.websocket) { | ||
dispatcher.push(['GET', t('/websocket'), ['sockjs_websocket']]); | ||
prefix_dispatcher.push(['GET', p('/websocket'), ['raw_websocket']]); | ||
transport_dispatcher.push(['GET', t('/websocket'), ['sockjs_websocket']]); | ||
} else { | ||
dispatcher.push(['GET', t('/websocket'), ['cache_for', 'disabled_transport']]); | ||
prefix_dispatcher.push(['GET', p('/websocket'), ['cache_for', 'disabled_transport']]); | ||
transport_dispatcher.push(['GET', t('/websocket'), ['cache_for', 'disabled_transport']]); | ||
} | ||
return dispatcher; | ||
return prefix_dispatcher.concat(transport_dispatcher); | ||
}; | ||
@@ -180,3 +183,3 @@ | ||
}, | ||
sockjs_url: 'https://cdn.jsdelivr.net/sockjs/0.3.4/sockjs.min.js' | ||
sockjs_url: 'https://cdn.jsdelivr.net/sockjs/1.0.1/sockjs.min.js' | ||
}; | ||
@@ -183,0 +186,0 @@ if (user_options) { |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.9.1 | ||
// Generated by CoffeeScript 1.9.3 | ||
(function() { | ||
@@ -3,0 +3,0 @@ var EventSourceReceiver, transport, utils, |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.9.1 | ||
// Generated by CoffeeScript 1.9.3 | ||
(function() { | ||
@@ -3,0 +3,0 @@ var HtmlFileReceiver, iframe_template, transport, utils, |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.9.1 | ||
// Generated by CoffeeScript 1.9.3 | ||
(function() { | ||
@@ -3,0 +3,0 @@ var JsonpReceiver, transport, |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.9.1 | ||
// Generated by CoffeeScript 1.9.3 | ||
(function() { | ||
@@ -73,2 +73,7 @@ var FayeWebsocket, RawWebsocketSessionReceiver, Transport, WebSocketReceiver, transport, utils, | ||
})(this)); | ||
this.heartbeat_cb = (function(_this) { | ||
return function() { | ||
return _this.heartbeat_timeout(); | ||
}; | ||
})(this); | ||
WebSocketReceiver.__super__.constructor.call(this, this.connection); | ||
@@ -94,3 +99,3 @@ } | ||
x = _error; | ||
return this.didClose(1002, 'Broken framing.'); | ||
return this.didClose(3000, 'Broken framing.'); | ||
} | ||
@@ -141,2 +146,18 @@ if (payload[0] === '[') { | ||
WebSocketReceiver.prototype.heartbeat = function() { | ||
var hto_ref, supportsHeartbeats; | ||
supportsHeartbeats = this.ws.ping(null, function() { | ||
return clearTimeout(hto_ref); | ||
}); | ||
if (supportsHeartbeats) { | ||
return hto_ref = setTimeout(this.heartbeat_cb, 10000); | ||
} else { | ||
return WebSocketReceiver.__super__.heartbeat.apply(this, arguments); | ||
} | ||
}; | ||
WebSocketReceiver.prototype.heartbeat_timeout = function() { | ||
return this.session.close(3000, 'No response from heartbeat'); | ||
}; | ||
return WebSocketReceiver; | ||
@@ -143,0 +164,0 @@ |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.9.1 | ||
// Generated by CoffeeScript 1.9.3 | ||
(function() { | ||
@@ -90,3 +90,3 @@ var XhrPollingReceiver, XhrStreamingReceiver, transport, utils, | ||
var headers, origin; | ||
if (!req.headers['origin'] || req.headers['origin'] === 'null') { | ||
if (!req.headers['origin']) { | ||
origin = '*'; | ||
@@ -93,0 +93,0 @@ } else { |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.9.1 | ||
// Generated by CoffeeScript 1.9.3 | ||
(function() { | ||
@@ -168,3 +168,3 @@ var GenericReceiver, MAP, ResponseReceiver, Session, SockJSConnection, Transport, closeFrame, register, stream, utils, uuid, | ||
headers = {}; | ||
ref = ['referer', 'x-client-ip', 'x-forwarded-for', 'x-cluster-client-ip', 'via', 'x-real-ip', 'host', 'user-agent', 'accept-language']; | ||
ref = ['referer', 'x-client-ip', 'x-forwarded-for', 'x-cluster-client-ip', 'via', 'x-real-ip', 'x-forwarded-proto', 'x-ssl', 'host', 'user-agent', 'accept-language']; | ||
for (i = 0, len = ref.length; i < len; i++) { | ||
@@ -216,3 +216,3 @@ key = ref[i]; | ||
_this.to_tref = setTimeout(x, _this.heartbeat_delay); | ||
return _this.recv.doSendFrame("h"); | ||
return _this.recv.heartbeat(); | ||
} | ||
@@ -339,2 +339,3 @@ }; | ||
GenericReceiver.prototype.didAbort = function() { | ||
this.delay_disconnect = false; | ||
return this.didClose(); | ||
@@ -367,2 +368,6 @@ }; | ||
GenericReceiver.prototype.heartbeat = function() { | ||
return this.doSendFrame('h'); | ||
}; | ||
return GenericReceiver; | ||
@@ -369,0 +374,0 @@ |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.9.1 | ||
// Generated by CoffeeScript 1.9.3 | ||
(function() { | ||
@@ -3,0 +3,0 @@ var array_intersection, crypto, escapable, lookup, unroll_lookup; |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.9.1 | ||
// Generated by CoffeeScript 1.9.3 | ||
(function() { | ||
@@ -237,3 +237,3 @@ var GenericApp, execute_request, fake_response, fs, http, querystring, url, utils; | ||
GenericApp.prototype.h_no_cache = function(req, res, content) { | ||
res.setHeader('Cache-Control', 'no-store, no-cache, must-revalidate, max-age=0'); | ||
res.setHeader('Cache-Control', 'no-store, no-cache, no-transform, must-revalidate, max-age=0'); | ||
return content; | ||
@@ -240,0 +240,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.15", | ||
"version": "0.3.16", | ||
"author": "Marek Majkowski", | ||
@@ -20,3 +20,3 @@ "bugs": { | ||
"dependencies": { | ||
"faye-websocket": "^0.9.3", | ||
"faye-websocket": "^0.10.0", | ||
"node-uuid": "^1.4.1" | ||
@@ -23,0 +23,0 @@ }, |
@@ -51,3 +51,3 @@ [![NPM version](https://badge.fury.io/js/sockjs.svg)](http://badge.fury.io/js/sockjs) | ||
var echo = sockjs.createServer({ sockjs_url: 'http://cdn.jsdelivr.net/sockjs/0.3.4/sockjs.min.js' }); | ||
var echo = sockjs.createServer({ sockjs_url: 'http://cdn.jsdelivr.net/sockjs/1.0.1/sockjs.min.js' }); | ||
echo.on('connection', function(conn) { | ||
@@ -103,3 +103,3 @@ conn.on('data', function(message) { | ||
its url (if you're unsure, point it to | ||
<a href="http://cdn.jsdelivr.net/sockjs/0.3.4/sockjs.min.js"> | ||
<a href="http://cdn.jsdelivr.net/sockjs/1.0.1/sockjs.min.js"> | ||
the latest minified SockJS client release</a>, this is the default). | ||
@@ -314,3 +314,5 @@ You must explicitly specify this url on the server side for security | ||
Note: This endpoint will *not send any heartbeat packets*. | ||
Deployment and load balancing | ||
@@ -317,0 +319,0 @@ ----------------------------- |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
107826
44
1870
444
3
6
+ Addedfaye-websocket@0.10.0(transitive)
- Removedfaye-websocket@0.9.4(transitive)
Updatedfaye-websocket@^0.10.0