I have the following working sample:
const junction=require('junction');
var app = junction()
.use(junction.messageParser())
.use(junction.presenceParser());
app.connect({ jid: 'admin@example.com', password: 'admin' }).on('online', function() {
console.log('connected as: ' + this.jid);
this.send(new Presence());
});
But when i try to run it like:
NODE_ENV=dev DEBUG="xmpp:*,junction" node ./src/index.js
I get the following errors:
Cannot load StringPrep-0.1.0 bindings. You may need to `npm install node-stringprep'
junction use * messageParser +0ms
junction use * presenceParser +0ms
(node:7800) [DEP0064] DeprecationWarning: tls.createSecurePair() is deprecated. Please use tls.Socket instead.
events.js:188
throw err;
^
Error: Unhandled "error" event. (XMPP authentication failure)
at Client.emit (events.js:186:19)
at Client.onRawStanza (/home/pcmagas/Kwdikas/master_thesis/junction/node_modules/node-xmpp/lib/xmpp/client.js:124:18)
at emitOne (events.js:116:13)
at Client.emit (events.js:211:7)
at Client.Connection.onStanza (/home/pcmagas/Kwdikas/master_thesis/junction/node_modules/node-xmpp/lib/xmpp/connection.js:237:14)
at StreamParser.<anonymous> (/home/pcmagas/Kwdikas/master_thesis/junction/node_modules/node-xmpp/lib/xmpp/connection.js:136:14)
at emitOne (events.js:116:13)
at StreamParser.emit (events.js:211:7)
at Parser.<anonymous> (/home/pcmagas/Kwdikas/master_thesis/junction/node_modules/node-xmpp/lib/xmpp/stream_parser.js:42:22)
at emitOne (events.js:116:13)
On nodejs version 8.11.1 results ending the programm whilst on nodejs 10.13.0 just throws this warning and continues without the online event happens.
I have the following working sample:
But when i try to run it like:
I get the following errors:
On nodejs version
8.11.1results ending the programm whilst on nodejs10.13.0just throws this warning and continues without theonlineevent happens.