a canadian startup

my name is ali asaria — this is my blog. I am the founder of Well.ca. I live in Guelph, Ontario, Canada. you can contact me at [myfirstname]@[thisdomainname]

more about ali asaria



Ali Asaria's Facebook profile
View Ali Asaria's profile on LinkedIn
    Permalink
    Feb
    14
    Thu
  1. JabBox Update #1

    My new project, JabBox, is on to it’s first working iteration.

    It was considerably harder to make a working model from my original prototype as I discovered more and more challenges. Now I realize why others haven’t done this!

    The first challenge is to maintain open chats. If the browser is communicating with the webmaster, the server must maintain an open thread on behalf of the browser that can accept incoming messages from the webmaster. Open threads are a challenge in standard HTTP models. In my prototype, I hacked this using PHP, keeping page requests open that would stay alive for a long time (~5 min). PHP is really not designed for this, and times-out the pages after a while. It felt bad. It was bad.

    I knew I’d want to use Java for this, but that meant learning how to code in Java again (hadn’t done so in years). Then I had to learn how to make a Java webserver. (#2 on diagram) I know nothing about this kind of stuff. I chose Jetty. The documentation on the Jetty site was confusing and it took me hours and hours (plus a bit of advice from Chris) to get a project set up. Once I got it set up, I had to port all my PHP jabber library calls to the new Smack API libraries that I was using on Java.

    The second big challenge was cross-domain AJAX blocking from browsers. You see, now that we have a second HTTP server (through embedded jetty), it has to listen on a different port than Apache (unless I set up Apache’s mod_proxy which would make it complicated for others to use my software). But Firefox and IE block AJAX calls that look like they’re going to a different site for security reasons. Firefox thinks we are going to a different site when you make a call to a different port on the same server.

    The solution I had for now was to set up a hand-made PHP proxy (#1 on diagram) that simply took calls and then made a second call, using libcurl, to the Jetty server. This costs extra resources and memory, but it is a simple solution that works.

    Here is a diagram of how it all works:

    photo-521.jpg

    I find it cool how many different technologies are being used here:

    On the front end:

    On the Backend:

    Note how many of the above technologies are opensource, the starred (*) ones are tools I am using for the first time.

    I will take a break from this for some days (need to clean my house) and update you all later. If you’d like to test this out on your own test site, please let me know and I can send you the files and we can work on this together. I will open something to the public as soon as the first tier of features are implemented.

  2. 4 Responses to “JabBox Update #1”

    1. Jesse Says:

      Do you find it may go offline at all? When we inserted a jabber client into our Chatter application (Twitter clone) we found that after a while it just froze. It could be the fault of the virtual machine or Ruby or Mongrel (restarting Mongrel boots it up again) but it was annoying.

    2. ali Says:

      No such problem so far. XMPP is good about errors — so if something bad did happen, it can stored in the db and handled in multiple ways. But to be honest, no reports of anything like that yet. The plan right now is to make the client side pull off then cut off if there is no communication after a certain amount of time (because the constant polling is annoying from a server perspective) — it will have a way to restart the conversation, though.

    3. a canadian startup » Blog Archive » First Demo of imWell — Well.ca’s LiveChat Program and Launch of labs.well.ca Says:

      [...] O’Connor, our newest software developer, based on an initial (and bad) prototype that I made some months ago. William chucked my prototype in the garbage, rewriting the backend server using Comet [...]

    4. sooaobmqv Says:

      wooyl9 cuhvzsrohdhn, [url=http://vytptspzctyu.com/]vytptspzctyu[/url], [link=http://dsevzjdhwomz.com/]dsevzjdhwomz[/link], http://xvgzlhkazxvr.com/

    leave a reply

Site Meter