Showing posts with label gsoc. Show all posts
Showing posts with label gsoc. Show all posts

Monday, July 28, 2008

Another progress report

I improved the handling of HTTP connections in my implementation. It now supports non-persistent connections to ejabberd and keep-alive and pipelining connections to Openfire (using Safa's dev build). I also implemented acknowledgments checking and key-sequencing. Additionally, I made some modifications to the proxy group stored in the Gajim config file. The configuration dialog for BOSH proxy has slightly changed to allow an optional set of HTTP proxy before the Connection Manager.

Next, I will focus on securing BOSH TCP connections. Currently, Gajim attempts to establish an SSL connection first and falls back to plain text when SSL negotiation or handshake fails. When connecting to the Connection Manager via BOSH, there shouldn't be an issue as long as the client goes directly to CM. The protocol used (XMPP or HTTP) over SSL doesn't matter in this case, although there is no negotiation within BOSH. However, when a proxy is used, I observed that Firefox sends an HTTP request with the CONNECT method to the proxy, which opens a tunnel to the remote machine. The SSL handshake then occurs on the opened channel. I will adopt the same approach because there seems to be no other way to tunnel HTTPS over a proxy.

With the tunnel established using CONNECT, it would be more reasonable to send XMPP directly instead of using BOSH over HTTP. However, CONNECT is usually limited to certain port numbers. Nonetheless, I believe it should be possible to achieve the same with BOSH as well (Gajim already supports XMPP via HTTP proxy using the CONNECT method).

Sunday, June 15, 2008

Third week of GSoC

In the past two weeks, I realized that the design I proposed in my previous post was flawed. The socket wrapper in xmpppy doesn't allow for multiple wrappers per client, and it has unnecessary functionalities for the TCP connection object. Therefore, I am currently refactoring the NonBlockingTcp and NonBlockingClient classes in xmpppy. My next step will be implementing a BOSHTransport that can be plugged into the client just like the socket wrapper. Please note that this is still subject to change, so I will provide a class diagram next week.

In the meantime, I have created a unit testing template for NonBlockingClient. I have also set up openfire, punjab, and araneo on my virtual server for testing purposes, and jwchat on localhost for traffic analysis.

You may have noticed my posts appearing multiple times on planet jabber. This is because whenever I edit a post, Blogger updates the <updated> tag in the feed, and the planet reader sorts entries based on the update time instead of the original publication time. Unfortunately, I haven't found a way to ignore entry updates in the planet reader or exclude the update time from the Blogger feed. I am considering moving to Wordpress, as it allows for importing the blog from Blogger, or finding a way to manipulate the feed on my own. Until then, I won't be able to maintain information in my posts or fix any typos.

For a comprehensive list of XMPP software that supports BOSH, you can now visit the jabber.org wiki. I noticed a few more tigase projects on the list that I wasn't aware of, which is pretty cool.

Saturday, May 31, 2008

First steps

I'm providing a summary of my progress in the first six days of GSoC coding. Throughout the coding period, I plan to publish a blog post every weekend to document my journey.

My project focuses on expanding the functionality of the Gajim jabber client. To begin, I delved into understanding the existing code responsible for XMPP communication. Gajim utilizes a modified version of the xmpppy library, which includes non-blocking transports with callbacks and message queues to notify connected objects at regular intervals. The Gajim architecture involves three relevant layers: the Connection class, acting as the interface between the UI and xmpppy (one instance per jabber account); the Client class, responsible for establishing the connection to the XMPP server and handling authentication; and the transport classes that format data for different protocols (SSL, TLS, TCP, HTTP proxy, SOCKS5 proxy). The transports themselves are not aware of XMPP stanzas.

In the case of BOSH (Bidirectional-streams Over Synchronous HTTP) messages, XMPP messages are wrapped within a body tag containing BOSH-related attributes. These messages are sent to an HTTP server or proxy known as the Connection Manager, instead of directly to the XMPP server. The communication scheme differs slightly to allow for server-initiated requests in HTTP (refer to XEP-0124). Based on this understanding, I determined the starting point for my coding efforts. Considering the variation in stream initiation between XMPP over BOSH and plain XMPP, I decided to create a BOSHClient class derived from NBCommonClient. In the existing code, the Connection object holds an instance of NonBlockingClient, also derived from NBCommonClient, as shown in the class diagram.



The plan is to utilize the BOSHClient instead of NonBlockingClient for accounts connecting to the BOSH Connection Manager. Currently, I have successfully built and sent the initial request, received and parsed the response, albeit with limited error checking. My next steps involve integrating the Gajim module for SASL authentication and subsequently sending the first message via BOSH.

Monday, April 21, 2008

I'm accepted for GSoC 08

At about 10:30 PM Finnish time yesterday, I learned that my Google Summer of Code proposal "BOSH support in Gajim" was accepted by the XMPP Standards Foundation. I'll be working on BOSH, a way to tunnel XMPP via HTTP. This is something I found missing in Gajim during my previous job, where only HTTP/S outgoing application traffic was allowed.

The following morning, I was overwhelmed by over 200 new messages from the gsoc-student mailing list. Interestingly, I'm not the only one tackling BOSH this year. Safa Sofuoğlu is also working to improve BOSH support in Openfire, a server implementation I plan to test against.

It's unusual to have my entire summer planned out in mid-April, especially with remnants of snow still visible. Attached is a typical late April snapshot of Finland's nature from Koli National Park.