I am trying to build a new web based client for Openfire to replace the outdated and abandoned Flash-based Sparkweb. The project is called Pade (A Yoruba word for Meeting) and my first step was to decide on my web client API.

 

Representational state transfer (REST) has now become the standard for abstracting request/response type web services into an API. When it is combined with Server Sent Events (otherwise known as Event Source), the result is a fresh new way of providing two-way real-time communication between web clients and a server using synchronous requests/responses (IQ) with REST and asynchronous evening (Message, Presence) with SSE. The really cool feature of SSE is the automatic re-connection by the web browser.

 

The Rest API plugin by Redor is brilliant . It allows you to administer Openfire via a RESTful API. Most of the common functions we do from the Openfire admin console web application can now be automated and integrated into server-side Java plugins or client-side web applications with ease. After spending hours inside the code and extending it for use at work to manage all the telephony entities we use with our Openlink XEP from the various commercial plugins we develop, it became clear that REST+SSE is the way forward for web-based real time messaging. Don't take my work for it. Read what the folks at erlang-solutions.com have to say.

 

As my first step towards implementing Pade, I have built a Chat API plugin by extending the REST API plugin with SSE and Jetty web authentication taken from the Openfire meetings plugin. The plugin now runs on the HTTP-BIND (7070/7443) port instead of the admin (9090/9091) port. It authenticates you as an Openfire user once and reuses the authentication for REST,  SSE and XMPP bosh/websockets. It supports everything you can do with the REST API plus Bookmarks and SIP Accounts as an admin user. It then enables you as a normal user to handle presence, chat, groupchat, contacts and users with just a handful of REST requests and SSE events.

 

Documentation can be found on GitHub Wiki pages