Sunday, July 13, 2008

Midterm update

After some structure changes in Gajim XMPP code I finally got to implementing HTTP connections handling and now my branch can be used with BOSH Connection Managers in ejabberd 2.0.1 and Openfire 3.5.2. You can find it in Gajim svn:

svn co svn://svn.gajim.org/gajim/branches/bosh_support@9924

In order to connect over http bindings you need to create proxy with type "BOSH" in Proxy Managing dialog (Accounts -> tab Connection -> Manage next to Proxy combobox), and put Connection Manager URI and port to text fields.
However it's still quite buggy and I haven't tried it over proxy yet. Next item on my TODO are the semantic issues of the protocol, then TLS support and config dialog. I also broke down some parts of networking code and I'll have to fix those before merging back to trunk.

Two things I noticed about Openfire - it doesn't respond to stream-restart body tag after SASL authentication and it doesn't classify iq stanzas (children of body tag) with XML namespace. Latter caused XML parser in Gajim consider the iq stanzas as of http://jabber.org/protocols/httpbind namespace because that's xmlns of parent body.

2 comments:

Lukáš 'Spike' Polívka said...

Nice.

It would be neat if you could auto-detect that you need to connect through HTTP proxy (after several fails with normal methods?) and then use BOSH automagically (and of course, you can find out BOSH URL automagically using DNS TXT records).

TomK said...

Yeah I read XEP 0156 and planned to do sth for it - what I thought about was having a button in account config called like "discover alternative methods" opening small window with TXT request results so user could just copypaste it to BOSH CM URI field.

Nevertheless it really makes more sense to look for and try the alternative methods from TXT records right after failed connect to XMPP port on host/s from SRV response, it's even obtained in similar manner (and it involves less GUI coding :)). I agree it would be cool to make Gajim connecting from behind fw without any configuring.

Anyway, above should work for client behind restrictive fw with transparent HTTP proxy without authorization on port 80, supposing the client connects to BOSH CM listening on 80. But what if the BOSH CM runs on different port. If the fw most likely blocks the desired port num, should the HTTP requests with BOSH messages be sent to 80 with CM host and CM port specified in HTTP header? Not mentioning TLS. I think I'll go back to this later.