code: function() {
      var self = this;
  
      self.jabber.on('data', function(buffer) {
        console.log('  IN > ' + buffer.toString());
      });
  
      var origSend = this.jabber.send;
      self.jabber.send = function(stanza) {
        console.log(' OUT > ' + stanza);
        return origSend.call(self.jabber, stanza);
      };
    }
docs: Helper function that overrides the XMPP `send` method to allow incoming and outgoing debugging.