Sunday, July 13, 2008

Midterm update

I made changes to the Gajim XMPP code to support HTTP connections. Now, my branch is compatible 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

To connect using HTTP bindings, create a proxy of type "BOSH" in the Proxy Managing dialog (Accounts -> Connection tab -> Manage next to Proxy combobox). Then, enter the Connection Manager URI and port in the respective text fields.

Please note that there are some bugs, and I haven't tested it with a proxy yet. My next tasks include addressing protocol issues, adding TLS support, and fixing networking code before merging it back to the main codebase.

I also observed two issues with Openfire: it doesn't respond to the stream-restart body tag after SASL authentication, and it doesn't classify iq stanzas (children of the body tag) with an XML namespace. This caused the XML parser in Gajim to consider the iq stanzas as part of the http://jabber.org/protocols/httpbind namespace because it's the parent body's xmlns.

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.