JavaScript Jabber Client Library
JavaScript PHP C CSS Makefile Batchfile Other
Clone or download
Latest commit 64ce30f Mar 13, 2018
Failed to load latest commit information.
examples Remove Facebook chat support Oct 17, 2013
src Fix Websocket Mar 12, 2018
utils Update bundled jsmin Nov 3, 2013
.editorconfig Add editorconfig file Nov 3, 2013
.gitignore Update JSHint configuration Nov 4, 2013
.jshintignore Update JSHint configuration Nov 4, 2013
.jshintrc Update JSHint configuration Nov 4, 2013
AUTHORS add Janusz Dziemidowicz as author Jan 18, 2013
ChangeLog upd Oct 19, 2012
Makefile add nodoc target for convenience Mar 25, 2014
README linked README to Apr 14, 2012 remove weird comment Aug 2, 2016
gpl-2.0.txt changed licensing to Mozilla's tri-license model Jun 17, 2008
lgpl-2.1.txt changed licensing to Mozilla's tri-license model Jun 17, 2008

JSJaC - JavaScript Jabber Client Library

JSJaC is an XMPP (formerly known as Jabber) client library written in JavaScript to ease implementation of web based XMPP clients. For communication with an XMPP server it needs to support either HTTP Polling or XMPP Over BOSH (formerly known as HTTP Binding) or XMPP Over WebSocket. JSJaC has an object oriented interface which should be quite easy to use. Communication is done by using the HTTPRequest object (also refered to as AJAX technology) or WebSocket. Your browser must support this. JSJaC is fully compatible with all major JavaScript frameworks.

Note: As security restrictions of most modern browsers prevent HTTP Polling from being usable anymore this module is disabled by default now. If you want to compile it in use 'make polling'.


JSJaC is licensed under the terms of the Mozilla Public License version 1.1 or, at your option, under the terms of the GNU General Public License version 2 or subsequent, or the terms of the GNU Lesser General Public License version 2.1 or subsequent.

The complete text of each of these license can be found in the same directory as this file. See

  • MPL-1.1.txt - for version 1.1 of the Mozille Public License
  • gpl-2.0.txt - for version 2 of the GNU General Public License
  • lgpl-2.1.txt - for version 2.1 of the GNU Lesser General Public License


In order to build a single compressed file to be included from within your app please run make at the top level directory of this project.

Hints on Usage

Service Address

Let's say your JSJaC based web application is located at Your XMPP server is at and it's HTTP Binding service is located at or

  • You could use mod_proxy and mod_rewrite to connect to jabber server:
    <VirtualHost *>
      DocumentRoot /var/www
      AddDefaultCharset UTF-8
      RewriteEngine On
      RewriteRule ^/http-bind/ [P]

With this you'd end up having access to the Jabber server's service at (the httpbase address).

  • You could use cross domain requests directly to jabber server without any proxy server:
    var oDbg = new JSJaCConsoleLogger(3);
    var connector = new JSJaCHttpBindingConnection({
        oDbg: oDbg,
        httpbase: '',
        timerval: 500

More information:

Debug Logger

JSJaCConnection supports use of JSDebugger which is available separately.

JSJaC also ships with a class JSJaCConsoleLogger which lets you log to Firebug's and Safari's console.


For an example on how to use this library within your web application please have to look at examples/simpleclient.html or examples/simpleCrossDomainClient.html.

Supported Browsers and Platforms

The following browsers are known to work with HTTP Binding. Let me know about others!

  • Microsoft Internet Explorer 6/7/8/9
  • Firefox 2.0.x and newer (and probably most other Gecko based browsers)
  • Opera 9 and newer
  • Chrome/Safari (and probably most other Webkit based browsers)

The following browsers are known to work with cross domain requests.

  • Internet Explorer 8 and newer
  • Opera 12 and newer
  • Firefox 3.5 and newer
  • Google Chrome 3 and newer

The following browsers are known to work with WebSocket.

  • Microsoft Internet Explorer 10
  • Firefox 16 and newer
  • Chrome 16 and newer
  • Opera 12.10, but will not work if a proxy is configured


Documentation is provided by JSDoc under the docs/ subdirectory if you've downloaded JSJaC as a tarball. Otherwise you can generate it on your own by make doc.

There's also an online version available at