lib/server.js
function on(str, opts, cbk) {
      cbk = (_.isFunction(opts)) ? opts : cbk;
      cbk = cbk || function() {};
      opts = opts || {};
      ssn.server.on(str, function() {
        if (!ssn.server || (!ssn.authenticating && !ssn.authenticated)) {
          //console.log("Not Authenticated. Closing Session.", ssn.authenticating, ssn.authenticated);
          self.parent._send("vantage-close-downstream", "downstream", { sessionId: ssn.id });
          return;
        }
        cbk.apply(self, arguments);
      });
    }
function on(str, opts, cbk) {
      cbk = (_.isFunction(opts)) ? opts : cbk;
      cbk = cbk || function() {};
      opts = opts || {};
      ssn.server.on(str, function() {
        if (!ssn.server || (!ssn.authenticating && !ssn.authenticated)) {
          //console.log("Not Authenticated. Closing Session.", ssn.authenticating, ssn.authenticated);
          self.parent._send("vantage-close-downstream", "downstream", { sessionId: ssn.id });
          return;
        }
        cbk.apply(self, arguments);
      });
    }
function on ( str , opts , cbk ) { cbk = ( _ . isFunction ( opts ) ) ? opts : cbk ; cbk = cbk || function ( ) { } ; opts = opts || { } ; ssn . server . on ( str , function ( ) { if ( ! ssn . server || ( ! ssn . authenticating && ! ssn . authenticated ) ) { //console.log("Not Authenticated. Closing Session.", ssn.authenticating, ssn.authenticated);
 self . parent . _send ( "vantage-close-downstream" , "downstream" , { sessionId : ssn . id } ) ; return ; } cbk . apply ( self , arguments ) ; } ) ; }
Listens for an event, authenticating the session first.
Listens for an event authenticating the session first .