lib/middleware/router.js
function Router(socket, options) {
  stream.Transform.call(this, { objectMode: true });

  this.options = merge(Object.create(Router.DEFAULTS), options || {});
  this.socket = socket;
}
function Router(socket, options) {
  stream.Transform.call(this, { objectMode: true });

  this.options = merge(Object.create(Router.DEFAULTS), options || {});
  this.socket = socket;
}
function Router ( socket , options ) { stream . Transform . call ( this , { objectMode : true } ) ; this . options = merge ( Object . create ( Router . DEFAULTS ) , options || { } ) ; this . socket = socket ; }
Routes messages parsed with courier to defined handlers by `type`
@constructor
@param {object} socket
@param {object} options
Routes messages parsed with courier to defined handlers by type