'use strict';

var xmpp = require('../index')
  , ltx = require('node-xmpp-core').ltx
  , pem = require('pem')

var r = new xmpp.Router()

var rawmsg = '<message to=\'mu@example.com\' from=\'juliet@nodexmpp.com/balcony\' '
rawmsg =  rawmsg + 'type=\'chat\' xml:lang=\'en\'><body>Wherefore art thou, mu?</body></message>'

pem.createCertificate({
    days: 100,
    selfSigned: true,
    organization: 'nodexmpp',
    organizationUnit: 'development',
    commonName: 'nodexmpp'

}, function (error, keys) {
    if (err) {
        console.error(error)
    } else {

        r.loadCredentials(
            'nodexmpp.com',
            keys.serviceKey,
            keys.certificate)

        r.register('nodexmpp.com', function (stanza) {
            console.log('GOT YA << ' + stanza.toString())
            if (stanza.attrs.type !== 'error') {
                var me = stanza.attrs.to
                stanza.attrs.to = stanza.attrs.from
                stanza.attrs.from = me
                r.send(stanza)
            }
        })

        var msg = ltx.parse(rawmsg)
        r.send(msg);
    }
})
@@ -510,16 +510,18 @@
  if (err
+or
 ) %7B%0A    
@@ -1090,8 +1090,9 @@
     %7D%0A%7D)
+%0A

Fix variable name