Juggernaut is Awesome.
So, I just took a few minutes out to take a look at Juggernaut, a plugin for Ruby on Rails that lets you provide instant, always-on communication with clients (as long as the website is open in a browser, anyway), using a combination of Flash and some JavaScript. I was able to set up the simple chat example in about 3-5 minutes, and started making my own modifications nearly immediately. Mostly, that’s thanks to Nicolas Cavigliano’s blog, where he has tutorials for using Juggernaut (see the “Juggernaut Tutorials” link on the right side of his blog). Once you install it (the rake task didn’t work for me, sadly), it also has a quick walkthrough.
One note is that the default communications port is 443. This is in some ways a good choice (the port is very rarely blocked by firewalls), but it is also a bad choice: in Linux/Unix, superuser permissions are required to host on this port, giving the server much more permission than it needs (and making any minor vulnerabilities in the server very serious). Also, the reason 443 is rarely blocked by firewalls is that it is the HTTPS default port. This means that it can’t coexist with any other SSL servers on the same IP address (at least, not those that use the default and best port to use). I’d recommend going with Nicolas’ suggestion of 1055 – it seems to work for me. Although I haven’t tried it behind any real-world restrictive firewalls, I know that it will work behind two of the major ones I’ve chanced upon, but you may find difficulties in different areas.
The only problem I can see so far is that the code somehow fails to escape some JavaScript code that is sent, so you’ll need to be extra-careful when sending data. If I get annoyed enough by it, I’ll probably make a quick patch, though it’s not a big deal if you’re looking for it.
Andy Schmitz