Saturday, July 5, 2008

Cross-Domain Xmpp4Js

I started implementing cross-domain functionality for xmpp4js. This will remove the requirement of running your own BOSH Servlet/proxy on the same domain as a Soashable installation. Instead, clients can now connect directly to the BOSH implementation of Openfire or ejabberd with no special proxy or Servlet.

This is accomplished by implementing the Alternative Script Syntax section of XEP-0124, which I did not know existed before =). The changes are in trunk, but in the spirit of Agile they are implemented in a way that works but is not elegant; I'll be working on that soon. It works in all major browers (though it limps in Opera for some reason).

There is an online demo here.

The biggest problem I've had is with "invalid" or "self-signed" SSL certificate warnings, which do not pop-up a warning in Safari or FF3 like they do in FF2. I am working on getting a real certificate.

Another interesting problem I faced was connections closing when I expanded the DOM element for the inserted <script> tag in Firebug's Inspector view. It seems that this prematurely closed the HTTP polling connection and interrupted the entire session.

It's become apparent that I need to work on protocol error handling.


Matthijs said...

Alternative Script syntax seems to be removed in version 1.7 of XEP-0124.

"Version 1.7 (2008-10-29)

Moved alternative script syntax to historical specification; added implementation note about HTTP Pipelining; adjusted architectural description.

How does this affect xmmp4js?

originalanaya said...


originalanaya said...

dead ?