sockjs
Advanced tools
Comparing version 0.3.18 to 0.3.19
{ | ||
"name": "sockjs-hapi", | ||
"version": "0.0.0-unreleasable", | ||
"dependencies": { | ||
"hapi": "*", | ||
"sockjs": "*" | ||
} | ||
"name": "sockjs-hapi", | ||
"version": "0.0.0-unreleasable", | ||
"dependencies": { | ||
"hapi": "15.x.x", | ||
"inert": "4.x.x", | ||
"sockjs": "*" | ||
} | ||
} |
@@ -9,3 +9,5 @@ /** | ||
// 1. Echo sockjs server | ||
var sockjs_opts = {sockjs_url: "http://cdn.jsdelivr.net/sockjs/1.0.1/sockjs.min.js"}; | ||
var sockjs_opts = { | ||
sockjs_url: "http://cdn.jsdelivr.net/sockjs/1.0.1/sockjs.min.js" | ||
}; | ||
@@ -19,17 +21,24 @@ var sockjs_echo = sockjs.createServer(sockjs_opts); | ||
// Create a server with a host and port | ||
var hapi_server = Hapi.createServer('0.0.0.0', 9999); | ||
// Create a server and set port (default host 0.0.0.0) | ||
var hapi_server = new Hapi.Server(); | ||
hapi_server.connection({ | ||
port: 9999 | ||
}); | ||
hapi_server.route({ | ||
method: 'GET', | ||
path: '/{path*}', | ||
handler: { | ||
directory: { path: './html', listing: false, index: true } | ||
} | ||
hapi_server.register(require('inert'), (err) => { | ||
hapi_server.route({ | ||
method: 'GET', | ||
path: '/{path*}', | ||
handler: function(request, reply) { | ||
reply.file('./html/index.html'); | ||
} | ||
}); | ||
}); | ||
//hapi_server.listener is the http listener hapi uses | ||
sockjs_echo.installHandlers(hapi_server.listener, {prefix:'/echo'}); | ||
sockjs_echo.installHandlers(hapi_server.listener, { | ||
prefix: '/echo' | ||
}); | ||
console.log(' [*] Listening on 0.0.0.0:9999' ); | ||
console.log(' [*] Listening on 0.0.0.0:9999'); | ||
hapi_server.start(); |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.11.0 | ||
// Generated by CoffeeScript 1.12.7 | ||
(function() { | ||
@@ -74,3 +74,3 @@ var utils; | ||
websocket: this.options.websocket, | ||
origins: ['*:*'], | ||
origins: !this.options.disable_cors ? ['*:*'] : void 0, | ||
cookie_needed: !!this.options.jsessionid, | ||
@@ -77,0 +77,0 @@ entropy: utils.random32() |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.11.0 | ||
// Generated by CoffeeScript 1.12.7 | ||
(function() { | ||
@@ -3,0 +3,0 @@ var iframe_template, utils; |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.11.0 | ||
// Generated by CoffeeScript 1.12.7 | ||
(function() { | ||
@@ -181,3 +181,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, | ||
}, | ||
sockjs_url: 'https://cdn.jsdelivr.net/sockjs/1.0.1/sockjs.min.js' | ||
sockjs_url: 'https://cdn.jsdelivr.net/sockjs/1/sockjs.min.js' | ||
}; | ||
@@ -184,0 +184,0 @@ if (user_options) { |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.11.0 | ||
// Generated by CoffeeScript 1.12.7 | ||
(function() { | ||
@@ -3,0 +3,0 @@ var EventSourceReceiver, transport, utils, |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.11.0 | ||
// Generated by CoffeeScript 1.12.7 | ||
(function() { | ||
@@ -3,0 +3,0 @@ var HtmlFileReceiver, iframe_template, transport, utils, |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.11.0 | ||
// Generated by CoffeeScript 1.12.7 | ||
(function() { | ||
@@ -3,0 +3,0 @@ var JsonpReceiver, transport, |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.11.0 | ||
// Generated by CoffeeScript 1.12.7 | ||
(function() { | ||
@@ -3,0 +3,0 @@ var FayeWebsocket, RawWebsocketSessionReceiver, Transport, WebSocketReceiver, transport, utils, |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.11.0 | ||
// Generated by CoffeeScript 1.12.7 | ||
(function() { | ||
@@ -90,2 +90,5 @@ var XhrPollingReceiver, XhrStreamingReceiver, transport, utils, | ||
var headers, origin; | ||
if (this.options.disable_cors) { | ||
return content; | ||
} | ||
if (!req.headers['origin']) { | ||
@@ -92,0 +95,0 @@ origin = '*'; |
@@ -1,4 +0,4 @@ | ||
// Generated by CoffeeScript 1.11.0 | ||
// Generated by CoffeeScript 1.12.7 | ||
(function() { | ||
var GenericReceiver, MAP, ResponseReceiver, Session, SockJSConnection, Transport, closeFrame, register, stream, utils, uuid, | ||
var GenericReceiver, MAP, ResponseReceiver, Session, SockJSConnection, Transport, closeFrame, register, stream, utils, uuidv4, | ||
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; }, | ||
@@ -9,3 +9,3 @@ hasProp = {}.hasOwnProperty; | ||
uuid = require('uuid'); | ||
uuidv4 = require('uuid/v4'); | ||
@@ -38,3 +38,3 @@ utils = require('./utils'); | ||
this._session = _session; | ||
this.id = uuid.v4(); | ||
this.id = uuidv4(); | ||
this.headers = {}; | ||
@@ -170,3 +170,3 @@ this.prefix = this._session.prefix; | ||
headers = {}; | ||
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']; | ||
ref = ['referer', 'x-client-ip', 'x-forwarded-for', 'x-forwarded-host', 'x-forwarded-port', 'x-cluster-client-ip', 'via', 'x-real-ip', 'x-forwarded-proto', 'x-ssl', 'dnt', 'host', 'user-agent', 'accept-language']; | ||
for (i = 0, len = ref.length; i < len; i++) { | ||
@@ -173,0 +173,0 @@ key = ref[i]; |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.11.0 | ||
// Generated by CoffeeScript 1.12.7 | ||
(function() { | ||
@@ -3,0 +3,0 @@ var array_intersection, crypto, escapable, lookup, unroll_lookup; |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.11.0 | ||
// Generated by CoffeeScript 1.12.7 | ||
(function() { | ||
@@ -3,0 +3,0 @@ var GenericApp, execute_request, fake_response, fs, http, querystring, url, utils; |
{ | ||
"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.18", | ||
"version": "0.3.19", | ||
"author": "Marek Majkowski", | ||
@@ -21,3 +21,3 @@ "bugs": { | ||
"faye-websocket": "^0.10.0", | ||
"uuid": "^2.0.2" | ||
"uuid": "^3.0.1" | ||
}, | ||
@@ -37,3 +37,8 @@ "devDependencies": { | ||
"url": "https://github.com/sockjs/sockjs-node.git" | ||
}, | ||
"scripts": { | ||
"version": "make build && git add Changelog", | ||
"postversion": "npm publish", | ||
"postpublish": "git push origin --all && git push origin --tags" | ||
} | ||
} |
@@ -76,4 +76,4 @@ [![NPM version](https://badge.fury.io/js/sockjs.svg)](http://badge.fury.io/js/sockjs) | ||
The API design is based on the common Node API's like | ||
[Streams API](http://nodejs.org/docs/v0.5.8/api/streams.html) or | ||
The API design is based on common Node APIs like the | ||
[Streams API](http://nodejs.org/docs/v0.5.8/api/streams.html) or the | ||
[Http.Server API](http://nodejs.org/docs/v0.5.8/api/http.html#http.Server). | ||
@@ -160,2 +160,9 @@ | ||
receiving connection wasn't seen for 5 seconds. </dd> | ||
<dt>disable_cors (boolean)</dt> | ||
<dd>Enabling this option will prevent | ||
<a href="https://en.wikipedia.org/wiki/Cross-origin_resource_sharing">CORS</a> | ||
headers from being included in the HTTP response. Can be used when the | ||
sockjs client is known to be connecting from the same origin as the | ||
sockjs server.</dd> | ||
</dl> | ||
@@ -162,0 +169,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
1
451
5
104060
39
1783
+ Addeduuid@3.4.0(transitive)
- Removeduuid@2.0.3(transitive)
Updateduuid@^3.0.1