I am using node-xmpp library to communicate with ejabberd server installed on ubuntu.
I have the following script to register and perform actions in the server..
var xmpp = require("node-xmpp");
var c2s = new xmpp.C2SServer({
port: 5223,
domain: 'domain.com'
});
c2s.on('connect', function(client) {
console.log('connect ??? ++++++++');
c2s.on('register', function(opts, cb) {
console.log('REGISTER')
cb(true)
})
client.on('authenticate', function(opts, cb) {
console.log('AUTH' + opts.jid + ' -> ' +opts.password)
cb(null) // cb(false)
})
client.on('disconnect', function() {
console.log('DISCONNECT')
})
});
I am able to see the connect message in the server. But its not invoking the register event.
However i have another ejabberd instance in 5222 port which is working fine for registration from Audium XMPP Client.