This is an implementation of WebSockets for the Openfire XMPP server. It consists a plugin for Openfire and a low-level JavaScript library suitable to be used with jQuery.
Why?
Recently, I have been involved in shaping an XMPP protocol extension (XEP) for simple application remote control of telephony devices for financial trading systems. This XEP is called Openlink and is still evolving.
I use XMPP Bosh to provide an Openlink Javascript library for web based applications and I am seeking to improve performance and scalability beyond the limitations of long-polling BOSH connections, so I decided to investigate replacing BOSH with Websockets in my Openlink Javascript library.
What did you do?
The Websocket protocol is close to finalising and Jetty (the embedded web server for Openfire) has been supporting WebSocket since Nov 2009 in version 7.0.1 which is the Jetty version in current Openfire 3.7.0. My first attempt of using the Jetty WebSocketServelet? class from Openfire 3.7.0 with Google Chrome web browser failed and I am not sure why. The WebSockets specification has changed a lot over the last two years and both Chrome and Jetty have kept up with it, so I was not surprised.
I therefore decided to recompile Openfire from SVN (version 3.7.1 Alpha) with latest Jetty 7.5.1 and finally got it working.
I then implemented a very thin XMPP stanza based Javascript class called openfire-websockets which exposes a minimium “Stophe” like connection object which I tested with the XMPP console application in chapter 4 of the book “Professional XMPP Programming with JavaScript and jQuery” by Jack Moffitt.
How?
You can use this plugin from Openfire 3.7.0. Just replace openfire.jar and slf4j-log4j12.jar in OPENFIRE_HOME\lib.
Should I?
If you do most of your application development with XMPP like I do, using Openfire and need fast and simple access to the low level XMPP messages as DOM elements in Javascript from JQuery right now, then take a look at openfire-websockets.js
I have not done any testing. I am hoping someone else with the infrastructure would.
I am relying on tha fact that the Jetty WebSocket implementation is tested and matured on 7.5.1 since the original 7.0.1 implementation. Jetty with Continuations scales very well. WebSockets should benefit from that. Only testing can confirm
I have no need to add that command. I get XMPP packets from the VirtualConnection class. The client application usually sets presence in order for user to become online and available
I use Openfire 3.8.2 alpha and ofchat-010 (withou websockets checked)
I can sign in but ofChat keeps grey
on server side i can see “only” any anonymous session for my ip, altough i logged in via my ldap user i also use with spark sucessfull.
Anonymous 452d980a Local Authenticated Online
Anonymous Login is allowed on server, however users authenticate against ldap and i logged in in ofchat with my ldap account i reagilary use with spark sucessfully.