Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

JavaScript Jabber Client Library

Fetching latest commit…

Cannot retrieve the latest commit at this time

JSJaC - JavaScript Jabber Client Library

JSJaC is a jabber client library written in JavaScript to ease
implementation of web based jabber clients. For communication with a
jabber server it needs to support either [1]HTTP Polling or [2]HTTP
Binding. JSJaC has an object oriented design which should be quite
easy to use. Communication is done by using the HTTPRequest
object also refered to as AJAX technology. Your browser must support 


JSJaC is licensed under the terms of the GNU Lesser General Public 
License (LGPL). Please refer to the file named 'COPYING' that came with 
this distribution for details.


In order to use JSJaC within your web application you have to include
the following javascript files:

* sha1.js
* xmlextras.js
* JSJaCConnection.js
* JSJaCPacket.js
* JSJaCHTTPPollingConnection.js

Due to security restrictions you will have to enable mod_proxy and
mod_rewrite for apache web server and add a RewriteRule for the domain
which serves your web application so that request on a certain base
address (which can be chosen by yourself) are redirect by use of
apaches built in proxy module to the http base address of the jabber
servers http polling or binding adresse. E.g.:

<VirtualHost *>
  DocumentRoot /home/jabber/jwchat/htdocs
  AddDefaultCharset UTF-8
  RewriteEngine On
  RewriteRule ^/http-poll/ [P]

Now start using it by:

var oDbg = new Debugger();
var oCon = new JabberHTTPPollingConnection(oDbg);

oCon.connect("","","test","web","secret"); // login in user with name "test", resource "web" and password "secret"

if (oCon.connected())
else {
  oDbg.log("Connection failed");

/* register handlers */

/* send presence */
oCon.send(new JSJaCPresence());

/* start handling incoming packets */
oCon.process(2000); // poll every 2 seconds

Note: JSJaCConnection supports use of [3]Debugger which is available separately.

For a more detailed example how to use this lib please have a look at
the examples subdirectory.

Supported Browsers and Platforms

* Internet Explorer v5.0 or newer
* Mozilla/Firefox and any other Gecko based browsers
* Netscape v6.0 or newer

* Mozilla/Firefox and any other Gecko based browsers
* Netscape v6.0 or newer

* Mozilla/Firefox and any other Gecko based browsers
* Safari (in development, please help out by submitting bug reports)

Something went wrong with that request. Please try again.