JSJaC 1.3

A new version of JSJaC is out. Thanks to patches from process-one and oDesk JSJaC 1.3 comes with tons of bugfixes and little improvements. Most notably each registered handler is executed with its context set to the underlying connection object, which means that you can access your jabber/XMPP connection with the ‘this’ keyword from within your handler now. This will allow for cool future improvements as I plan to ship JSJaC with code snippets that allow to automagically implement common tasks for you like Service Discovery replies and things like that. As a side effect JSJaC doesn’t rely on a global variable for the connection (formerly defined as ‘oCon’) anymore. Go get it now!

18 Responses to JSJaC 1.3


  1. Comment by Aadaam | 2008/02/12 at 20:47:03

    Hi Stefan,

    Does the JSJaC 1.x series support the old-style XEP-0124, I mean, not the BOSH namespace?

    It seems that I couldn’t connect the previous (1.2, tried this weekend) version with my openfire install.

  2. Comment by Steve | 2008/02/12 at 22:01:25

    Hi Aadaam, you’ve got to set JSJACHBC_USE_BOSH_VER to false at the top of jsjac.js (or src/JSJaCConfig.js if you’re not using the packaged version).

  3. Comment by Dave | 2008/02/13 at 23:52:28

    Hey Steve. Do you see any reason why JSJac wouldn’t work in an adobe AIR HTML/JS based app? I’ve tried with no luck connecting to OF.

  4. Comment by Steve | 2008/02/15 at 12:46:13

    Dave, sorry, my knowledge about AIR is not sufficient to answer this.

  5. Comment by Andrés Caro | 2008/02/27 at 22:37:47

    Hi Steve. JSJac 1.3 will be integrated in Jwchat in a short time?.

    I use Jwchat with Openfire 3.4.1 and it works fine, but have a little problem with the search Plugin from Openfire. I hope this issue could be fixed soon…

  6. Pat
    Comment by Pat | 2008/03/26 at 05:00:38

    First of all.. Great work! Thanks a bunch for you effort!

    I still haven’t been able to run it as I want to.

    I’ve got some problems with your client, I was thinking I could integrate it a website, not using Iframes, on a windows machine. So basically I run into cross-domain issues. I don’t want to put up a tomcat server and run your servlet on it so I tried with Ejabbered which got an “internal webserver” or that serv http-bind. So i put JSJaC on http://localhost/www/examples/simpleclient.html and try use this binding adress http://localhost:5280/http-bind. Now obviously this doesn’t work as it is a cross domain issue. So I tried to make a rewrite rule which cast http://localhost/http-bind to http://localhost:5280/http-bind. Works fine in the browser but not with JSJaC It seems the post goes through ok but the response i get is this:

    302 Found

    FoundThe document has moved here.

    Any ideas how to get JSJaC to work on windows with IIS and any kind of Jabber server?

  7. Comment by Patrick | 2008/03/26 at 11:19:44


    I was wondering if I integrate JSJaC on my webpage I would like it to handle presence on all pages. This is how I thought it out.

    On every page on my website I will use a scaled down version of JSJaC in an iframe that logs in the user so that the Jabber server (in this case ejabberd) knows that the user is online. If there is an incoming chat then a popup with full version JSJaC will load. I want to use http-bind to minimize bandwidth usage.

    My questions are these.

    If I switch between pages what will happen to the connection at the server side? Will a new one be created and the old one dropped? Or will a new connection be created each time and the old one drop on timeout?

    In the new message scenario. What happens when the popup loads? I log in with the same user name and password so the old connection should be broken I guess.. is there anyway to pass connection between windows?

    I know these are rather odd questions but any help is appreciated.

  8. Comment by Steve | 2008/04/07 at 11:05:43

    Latest versions of jsjac and ejabberd’s http-bind support suspend/resume of http-binding sessions. So there’s no need to embed jsjac into an iframe. You can use it on your page just as any other javascript. Onunload you should suspend the connection, onload trie to resume it. examples/simpleclient.html contains code to show this feature.

    And no, I’m sorry, I don’t know how to make jsjac work on ISS.

  9. Comment by Mark | 2008/04/07 at 14:41:21


    I asked few weeks ago about “Alternative Script Syntax” as outlined by http://www.xmpp.org/extensions/xep-0124.html#script.

    Is possible to implement it and are you going to implement it in the future in the http-bind ejabberd module?


  10. Comment by Steve | 2008/04/07 at 14:57:12

    Hi Mark, sorry, must have missed that.
    Currently I do not plan to support this feature. It’s cool stuff, but I don’t have time for it. Sorry.

  11. Comment by Mark | 2008/04/07 at 16:12:36

    Could you please give me some hints how to implement it?

    I guess it shouldn’t be too hard because I’ll only need to check if the request is GET or POST and if it

    is GET to encode the request in JSON and return it.

    Will it be easier to extend the module or to copy it and right another one?


  12. Comment by Mark | 2008/04/15 at 18:20:21

    I’m still trying to implement it.

    Can you give me some hints?


  13. Comment by Ilia | 2008/04/25 at 07:28:49

    Mark, please contact me as I’m implementing it too 🙂

    email: ilia-a t-flamefork.ru
    www: http://www.flamefork.ru/
    icq: 290365373
    jabber/gtalk: flamefork-a t-gmail.com

  14. Comment by noise | 2008/05/08 at 12:33:38

    I think this has been asked before but I can’t find any answer that get’s it working for me.

    I’m trying to run JSJaC 1.3 with Openfire (i can get it to run with ejabberd) but I just cant seem to get it to work. Have look at my post at ignite to see how i’ve configured my system http://www.igniterealtime.org/community/thread/32620?tstart=0 . Does anyone have any ideas?

  15. Comment by Parag | 2008/05/09 at 07:45:48

    Hi Steve,
    I am trying to use jsjac (1.3), JabberHTTPBind (1.1) and Openfire (3.5.1) for chat support. We need to use JabberHTTPBind instead of HTTP bind service from Openfire and we need all sessions as anonymous. I tried using simple client included in jsjac (as well as JWChat) to login on openfire server. With proper account I can login with no issues but when I am trying to login using some random username it throws authentication errors. On openfire server sessions it shows “Anonymous” session created but on client side it shows error. I also tried setting up authtype as anonymous from client but still it fails.
    My question is does jsjac/JabberHTTPBind supports anonymous logins or not. Can you please provide me some guidelines on how I can enable anonymous login using jsjac/JWChat?

  16. Comment by Steve | 2008/05/09 at 17:20:14

    Hi, JSJaC supports SASL Anonymous. I don’t know if Openfire’s support for anonymous login implements SASL Anonymous. Maybe it’s that it allows to connect with any arbitrary username doing normal SASL auth?
    If you want to see how anonymous login works you might have a look at MUCkl’s source code: https://trac.stefan-strigler.de/muckl/browser/trunk

  17. Comment by Steve | 2008/05/09 at 17:21:44

    @noise: guess you’re missing a trailing slash at

    RewriteRule http-bind/ [P]

  18. Ben
    Comment by Ben | 2008/05/14 at 14:27:06

    I understand that you are the man behind for the impressive ejabberd http_bind module.

    Can you give me an estimate of the number of concurrent users a single server can support?

    I’m sorry if this is the place only for jsjac related questions.

Comments are closed