JsJaC : JavaScript Jabber Client Library
February 1, 2006 on 2:21 pm | In General, Jabber, Javascript |Voici une petite librairie pour utiliser Jabber depuis le Javascript ! Ca marche en coordination avec un serveur Jabber qui gère le HTTP-Polling.
C’est compatible IE 5+, Gecko, Netscape 6+… donc très compatible !
voici un petit exemple pour m’envoyer un message :
//connexion
con = new JSJaCHttpPollingConnection();
con.connect(“http://monserveurJabber.com/http-poll”,“monserveurJabber.com”,“jb”,“JSresource”,“secret”,2000,0);
//envoi du message
var aMsg = new JSJaCMessage();
aMsg.setTo(“jb@jabber.fr”);
aMsg.setBody(“test message”);
con.send(aMsg);
con = new JSJaCHttpPollingConnection();
con.connect(“http://monserveurJabber.com/http-poll”,“monserveurJabber.com”,“jb”,“JSresource”,“secret”,2000,0);
//envoi du message
var aMsg = new JSJaCMessage();
aMsg.setTo(“jb@jabber.fr”);
aMsg.setBody(“test message”);
con.send(aMsg);
on peut envoyer, recevoir, gérer les présences…
Attention : si le domaine ou est la page web n’est pas le meme que celui ou est le http polling, il faudra prevoir une modif de le conf d’Apache (mod_proxy + mod_rewrite) pour rewriter le domaine et contourner la restriction javascript.
2 Comments »
RSS feed for comments on this post. TrackBack URI
Leave a comment
Powered by WordPress with Pool theme design by Borja Fernandez.
Entries and comments feeds.
Valid XHTML and CSS. ^Top^
Tu peux aussi regarder JSJab qui est la bibliothèque Javascript utilisée par http://www.sameplace.cc pour se connecter à un serveur Jabber de manière traditionnelle et pas par HTTP Poll.
Comment by Tiennou — 1 February 2006 #
en effet c’est encore mieux…. je vais test !!
Comment by site admin — 1 February 2006 #