anoopc / node-xmpp-via-bosh Goto Github PK
View Code? Open in Web Editor NEWxmpp api via bosh written with nodejs
xmpp api via bosh written with nodejs
After a while of running the service it results in some errors like these:
net.js:40
var TCP = process.binding('tcp_wrap').TCP;
^
RangeError: Maximum call stack size exceeded
warn - error raised: Error: accept EMFILE
events.js:73
throw new Error("Uncaught, unspecified 'error' event.");
^
Error: Uncaught, unspecified 'error' event.
at nxbClient.EventEmitter.emit (events.js:73:15)
at nxbClient.handle (/home/german/chat/node_modules/node-bosh-xmpp-client/lib/boshclient.js:136:9)
at sendHttp (/home/german/chat/node_modules/node-bosh-xmpp-client/lib/boshclient.js:88:68)
at ClientRequest.exports.xmlHttpRequest (/home/german/chat/node_modules/node-bosh-xmpp-client/lib/autil.js:67:3)
at ClientRequest.EventEmitter.emit (events.js:96:17)
at Socket.socketErrorListener (http.js:1331:9)
at Socket.EventEmitter.emit (events.js:96:17)
at Socket._destroy.self.errorEmitted (net.js:329:14)
at process.startup.processNextTick.process._tickCallback (node.js:244:9)
Error: xml parsing ERROR:
Error: xml parsing ERROR:
I don't know what's wrong. The server is Centos 6.3.
Hi,
I am using node-bosh-xmpp-client for send messages using below code
My code:
var xmpp1 = require("/node_modules/node-bosh-xmpp-client/lib/boshclient.js");
var myjid = "admin@localhost";
var mypassword = "admin123";
var friend = "test@localhost";
var bosh = "http://localhost:5280/http-bind";
var me = new xmpp1.Client(myjid + "", mypassword, bosh);
me.on('error', function(exception) {
console.log("Error: " + exception);
process.exit();
});
me.on('offline', function(reason) {
console.log("now offline because of " + reason);
process.exit();
});
me.on('online', function() {
//console.log("It feals great to be Online!!!!");
me.sendMessage(myjid, 'i am also expecting to recieve the message');
//main starts here
me.send(xmpp1.$pres());
me.sendMessage(friend,'hi, this is maddy!!!','chat');
});
me.on('stanza', function(ltxe) {
console.log("yeh i recieved something!!!")
console.log(ltxe.toString());
console.log("from:" + ltxe.attrs.from);
console.log("to:" + ltxe.attrs.to);
//console.log("message:" +ltxe.children[1].children);
return;
});
When I run this code getting error and messages are not showing in ejabbered admin page.
Please help me...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.