I’ve been writing a piece of software in order to perform a major upgrade of ZATEMAS, a specialized web app suite I’m a co-author on. Since there is a small community of users on it that might interact better if they had an opportunity to do so, I came to an idea to provide them with an instant messaging client built right into the browser, similar to Facebook Chat, Meebo Bar and Gmail Chat. I’ve picked XMPP as the protocol; better known as Jabber, this is the same protocol Google Talk uses.
Examining various options took a while. I’ve looked at Meebo Bar, and concluded that it doesn’t fit my use case, since I want users to be automatically logged in on a local XMPP server.
The only serious contender for the throne of the best open easily deployable web-based XMPP client is JWChat. This is a venerable old client which creates a popup and behaves much like a typical desktop IM client. This means it was unsuitable; there is no easy way to embed it in a page, yet preserve its state upon page switching.
That brings us to the other part of the XMPP stack. Which server to pick? Which BOSH connection manager to pick?
There are, really, two contestants in my arena when it comes to a server. First one is a veteran of XMPP, ejabberd. ejabberd is written in Erlang, and is massively scalable. It’s trivial to install and configure in Debian, and it supports a lot of cool features out of the box. It supports something called “shared rosters”, which basically means you can create groups in people’s contact lists that you, as the admin, can enforce to contain whomever you want. You can force people, for example, to see everyone else working in the company. This is a critical feature for ZATEMAS, just as is so-called “external authentication”. What I’m missing here is: external auth does not support fetching any attribute apart from basic operations with passwords (is it correct? please change it!), and vCard cannot be created from command line, only updated. This means I cannot trivially set people’s real names during an update run.
Obviously, ejabberd has flaws, and I cannot easily update it since Erlang is a language fundamentally different from any other I worked with.
So the second contender is a server I discovered only tonight. It’s Prosody, an extremely lightweight XMPP server written in Lua by a bunch of very friendly folks. I really like the attitude and personal approach the principal author of Prosody has, but that’s not all. Server’s source code looks extremely well organized, the server is quite featureful, and most importantly, it’s written in a language that mere mortals can understand. I’m not a big fan of Lua, but I can read it, and I can update it, especially when it’s so well written as Prosody seems to be.
I’m currently not very familiar with Prosody, but the fact that I managed to set it up very quickly and that it starts up momentarily… well, I think that we can hack a ZATEMAS-based external authentication module into it! Also, I think I might be able to better add my own debug functions, to easily see what I did wrong while developing my client.
Both ejabberd and Prosody come with a BOSH connection manager (the thing that translates HTTP requests into a continuous XMPP stream; a continuous XMPP TCP stream is something you cannot achieve from the web). So why another one?
Well, perhaps you want to log into Google Talk!
Yep, folks, that’s what PunJab allows: have your BOSH-based client log into any XMPP server. I must say I like PunJab; it’s written in Python. Despite that, its internals seem a bit less clear than Prosody’s, yet still manageable. PunJab does its job and does it extremely well.
So there you have it. Perhaps we’ll soon have an opportunity to talk about how to install Z-XMPP instead of just talking about why and how I’m working on an IM service
Until next time!