support websockets

This commit is contained in:
yawnt 2013-09-13 20:06:51 +02:00
parent 0fb33810f5
commit 4a4607d075
3 changed files with 21 additions and 4 deletions

View File

@ -30,11 +30,24 @@ function createRightProxy(type) {
return passes[pass];
});
return function(req, res, opts) {
return function(req, res /*, [head], [opts] */) {
var self = this,
ev = 'caronte:' + type + ':';
args = [].slice.call(arguments),
cntr = args.length - 1,
ev = 'caronte:' + type + ':',
head;
if(typeof opts !== 'undefined') { options = opts; }
if(
!(args[cntr] instanceof Buffer) &&
args[cntr] !== res
) {
options = opts;
cntr--;
}
if(args[cntr] instanceof Buffer) {
head = args[cntr];
}
options.ee.emit(ev + 'begin', req, res);

View File

@ -1,3 +1,6 @@
var WebsocketStream = require('../streams/websocket'),
passes = exports;
/*!
* Array of passes.
*

View File

@ -15,7 +15,8 @@
"dox" : "*",
"coveralls" : "*",
"mocha-lcov-reporter": "*",
"blanket" : "*"
"blanket" : "*",
"ws" : "*"
},
"scripts" : {
"blanket" : { "pattern": "caronte/lib" },