Skip to content
This repository

HTTPS clone URL

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

README
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 
this.

License
=======

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.

Usage
=====

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 *>
  Servername jabber.mydomain.com
  DocumentRoot /home/jabber/jwchat/htdocs
  AddDefaultCharset UTF-8
  RewriteEngine On
  RewriteRule ^/http-poll/ http://jabber.mydomain.com:5280/http-poll/ [P]
</VirtualHost>
%<---

Now start using it by:

%<-----
var oDbg = new Debugger();
var oCon = new JabberHTTPPollingConnection(oDbg);

oCon.connect("http://jabber.mydomain.com/http-poll/","jabber.mydomain.com","test","web","secret"); // login in user with name "test", resource "web" and password "secret"

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

/* register handlers */
oCon.registerHandler("message",handleMessage);
oCon.registerHandler("presence",handlePresence);
oCon.registerHandler("iq",handleIQ);

/* 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
================================

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

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

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


[1] http://www.jabber.org/jeps/jep-0025.html
[2] http://www.jabber.org/jeps/jep-0124.html
Something went wrong with that request. Please try again.