Strophe Preview: XMPP In JavaScript
June 30, 2008
Three years ago, we released libstrophe to the world. libstrophe is a cross-platform C library for writing XMPP clients. libstrophe exists because none of the C libraries at the time worked well on Windows platforms. A year or so later, I discovered the potential of XMPP on the Web and created a JavaScript version as a first step to a Web based Chesspark client. I never officially released strophe.js, but it is available under the GPL license for anyone who was brave enough to dig it out of the Chesspark JavaScript code. It’s time to make it official.
Some Features Of Strophe
Strophe has a lot of neat features. Probably the most compelling is that it has been well tested for 2 years in all major browsers. It catches many errors and includes optimizations that no other AJAX framework seems to. It has been used by hundreds of thousands of people via the Chesspark site.
Strophe was developed in a climate where low latency is critical. People do not enjoy waiting for game moves or clock updates, and so Strophe does its best to deliver excellent performance.
Strophe is very simple. Not only is the API small and easy to understand, but there are numerous helpers in there to make life easy. Strophe.Builder helps you build stanzas quickly. For example:
$iq({type: 'get'}) .c('query', {xmlns: Strophe.NS.ROSTER}) .toString()
Will generate this XML stanza:
<iq type='get'>
<query xmlns='jabber:iq:roster'/>
</iq>
Strophe In Action
If you’d like to see what is possible with Strophe, please check out the Chesspark Web client and the Speeqe demo site.
Take a Sneak Peek
I’m almost finished preparing Strophe 1.0 for release, which includes the original libstrophe C library, the strophe.js JavaScript library, and complete documentation for both. I hope to make Strophe the best XMPP library around for native or web development.
Until it is released, you can can see a preview of the JavaScript version or read the API documentation. This version was refactored and made more modular compared to the Chesspark version, and it hasn’t been fully tested yet. It does however work great in my initial tests with a slightly modified version of the Chesspark Web client.
I’m very interested in any feedback the community has for Strophe.
:EXTENDED: