Sunday, June 15, 2008

Third week of GSoC

During last two weeks I realized the design I proposed in previous post was not good because component plugging of socket wrapper into client instance in xmpppy does not allow to use more than one wrapper per client, plus the wrapper actually does more than I need for TCP connection object. Now I am refactoring NonBlockingTcp and NonBlockingClient classes in xmpppy and next step will be doing a BOSHTransport owning one or more instances of NonBlockingTcp. BOSHTransport should be pluggable to client just like usual socket wrapper. It is still a bit likely to change so I will keep class diagram for next week.
In meantime, I wrote a template for unit testing of NonBlockingClient and installed openfire, punjab and araneo on my virtual server for testing and jwchat on localhost for traffic analysis.

You may have noticed my posts bubbling up on planet jabber. Some of them got on top of aggregated feed more than once. It happened always after editing a post and it's because
  1. Blogger adds/updates the <updated> tag in feed on each post modification.
  2. Planet reader sorts entries by time in <updated> instead of <published>.
I didn't find a way how to ignore entry updates in planet reader yet.. or how to exclude update time from Blogger feed. I'm thinking about moving to Wordpress (blog can be imported from Blogger) or doing some magic with the feed on my own. But until then, there goes the idea of maintaining info in posts (and correcting typos :( ).

The list of XMPP soft supporting BOSH can be found on wiki now. I can see there a few more tigase projects I didn't know about, cool.

Sunday, June 1, 2008

BOSH in XMPP software

Sooner or later I will have to test my code with different servers and Connection Managers so I did some research about existing HTTP Binding implementations. BOSH is described in XEP-0124 and XEP-0206. 0124 describes mechanism, syntax and error handling for reliable transfer of XML streams over HTTP in general. 0206 addresses XMPP - session negotiation, XMPP errors processing and SASL authentication.

Besides client and server, there is a Connection Manager entity in BOSH architecture. Client communicates with CM via HTTP POST requests/responses defined in mentioned XEPs and CM communicates with XMPP server either acting as a ordinary XMPP client or using component protocol. CM can be standalone HTTP server or built-in functionality (or extension) of XMPP server. If you want to connect to XMPP server via BOSH CM, you need CM URL and CM port number (e.g. "" and 80 for[in czech]) in addition to XMPP server address and port. With built-in Connection Managers, IP addresses of XMPP server and CM will be the same and just the port numbers will differ.

Follows overview of XMPP software with BOSH support.

Servers with built-in Connection Manager.
Standalone Connection Managers
Act as a proxy between client and XMMP server.
  • gloox (C++) - BOSH support done by MattJ during GSoC 2007. BOSH Connection classes are included in svn trunk and 1.0-beta2 (download page).
  • xmpp4r (Ruby)
  • xmpp4js (JavaScript)
  • JSJaC (JavaScript)
  • emite (Google Web Toolkit, Java) - XMPP library and client GUI for gwt, connecting through BOSH Connection Manager.
I wasn't able to experiment with all listed software but I will keep updating this overview during summer as I'll progress with testing. Further reading can be this post on MattJ's blog.