I am planning to restart work on the confbot project. Here's some brief history on the project:
My friends discovered
GTalk Bots a month ago. Together with
Zatacka and Quake, it proved to be the source of this semester's end sem exam time fun. Again
Kush aka
Transporter broke all anagram records, and at one time, 4 of our wingmates were in the top ten scorers.
I found the idea pretty neat but the implementation wasn't very good. With an intention to do better and some other ideas of my own, I decided to code my own bot for Gtalk. I had always wanted an always-on group chat, where I could send out a message, and it would be forwarded to all wingies. Sort of a conference bot. That sort of thing would be handy in the everyday situation where I buzz each person, calling them to the canteen/mess. And I wanted to beat Kush at Anagrams, or at least make a bot that could do so :P
So I started my search for API that would be available for GTalk. The first thing that I find leads me to
this implementation of a Conference Bot for Gtalk. It is exactly the thing that I had in mind. Alas, it does not work behind proxies!
Now, I am not the kinda guy who would try and read somebody else's python code, but with some encouragement from Kush, the two of us dug into the source code for the conference bot. We found out that the bot was based on python module for Jabber clients available
here. It turns out that it is this library that needs to have proxy support. The newer version of jabber.py did provide proxy support, so we replaced the jabber.py library included with Conference bot with the newer version. But some problem with authentication over SSL caused other problems.
Since GTalk is based on Jabber/XMPP, a number of other APIs have been developed. One Java library for XMPP that looked promising was available from
Jive Software. A basic client could be ready in less than 15 lines of java code. The proxy support had been added only in the last beta release and turned out not to be so good. With some help from
this article, I coded a SocketFactory class to tunnel my http traffic through the proxy but again I encountered some problems.
Now with my own SocketFactory class with me, I was ready to write my own API. After getting me hands dirty with the specification for Jabber, I wrote java code that could connect to the gtalk server. I was successful in authenticating to the server (with some crucial help provided by
this blog). But unfortunately, the connection to the remote server closed after I had sent one message. So all I could do was authenticate myself :( I tried all combinations of Keep-Alive and Proxy-Keep-Alive in my HTTP headers but had no success. With the more important Computer Networks course exam coming close, I had to give up reading about HTTP headers for some time and mug up useless info for the exam.
Now that I am free again, I hope I can implement some of the cool ideas that are brewing in my mind.