var socket = require("socket.io").listen(server);
var xmpp = require("node-xmpp");
socket.on("connection", function(connection) {
var client = new xmpp.Client({jid: "charlvn@jabber.co.za", password: ""});
client.on("online", function() {
client.send(new xmpp.Element("presence", {type: "chat"}));
connection.on("message", function(message) {
client.send(new xmpp.Element("message", {to: "charlvn@charlvn.com", type: "chat"}).c("body").t(message));
});
connection.on("disconnect", function() {
client.end();
});
});
client.on("stanza", function(stanza) {
if (stanza.is("message")) {
var b = stanza.getChildren("body");
if (b[0]) connection.send(b[0].getText());
}
});
});
server.listen(8080);[/cc]
[cc lang="html"]
[/cc]
Is this example actually works? i want to try it...
ReplyDelete还没实验过。
ReplyDeleteacquire the most recent promotion codes from the protein works
ReplyDeletethe protein works discount coupons
Thanks for any other informative web site. The place else may I am getting that kind of info written in such a perfect manner? I have a project that I am just now operating on, and I've been at the glance out for such info.
ReplyDeleteYou actually make it seem really easy with your presentation however I in finding this topic
ReplyDeleteto be actually something which I think I might never understand.
It seems too complex and very huge for me. I'm taking a look ahead on your subsequent submit, I will attempt to get the cling of it!
Hi! This post couldn't be written any better! Reading through this post reminds me of my previous room mate! He always kept chatting about this. I will forward this page to him. Pretty sure he will have a good read. Thank you for sharing!
ReplyDelete