lib/push.js
function (options) {
    
    // Initialize the Faye client if it hasn't been initialized
    if (_.isUndefined(this._fayeClient)) {
     
      var pushUrl = new URI(this.apiURL).subdomain('push').path('faye').toString();
     
      this._fayeClient = new Faye.Client(pushUrl);
      
      // We don't support websockets
      this._fayeClient.disable('websocket');

      // Add extensions to Faye client
      this._fayeClient.addExtension({
        'outgoing': function(message, callback) {
          message.ext = message.ext || {};
          message.ext = {
            private_pub_signature: options.signature,
            private_pub_timestamp: options.timestamp
          };
          callback(message);
        }
      });
    }

    return this._fayeClient;
  }
function (options) {
    
    // Initialize the Faye client if it hasn't been initialized
    if (_.isUndefined(this._fayeClient)) {
     
      var pushUrl = new URI(this.apiURL).subdomain('push').path('faye').toString();
     
      this._fayeClient = new Faye.Client(pushUrl);
      
      // We don't support websockets
      this._fayeClient.disable('websocket');

      // Add extensions to Faye client
      this._fayeClient.addExtension({
        'outgoing': function(message, callback) {
          message.ext = message.ext || {};
          message.ext = {
            private_pub_signature: options.signature,
            private_pub_timestamp: options.timestamp
          };
          callback(message);
        }
      });
    }

    return this._fayeClient;
  }
function ( options ) { // Initialize the Faye client if it hasn't been initialized if ( _ . isUndefined ( this . _fayeClient ) ) { var pushUrl = new URI ( this . apiURL ) . subdomain ( 'push' ) . path ( 'faye' ) . toString ( ) ; this . _fayeClient = new Faye . Client ( pushUrl ) ; // We don't support websockets this . _fayeClient . disable ( 'websocket' ) ; // Add extensions to Faye client this . _fayeClient . addExtension ( { 'outgoing' : function ( message , callback ) { message . ext = message . ext || { } ; message . ext = { private_pub_signature : options . signature , private_pub_timestamp : options . timestamp } ; callback ( message ) ; } } ) ; } return this . _fayeClient ; }
Returns a reference to the Faye client and initializes it if needed
Returns a reference to the Faye client and initializes it if needed