I’ve been playing with Web Sockets using Google’s Chrome browser. Web Sockets, put simply, is a really nice way for a web application to talk to a remote server and allows the remote server to talk back. There are currently various ways of doing this with using Comet. But let’s be honest. Comet is a total hack. Web Sockets, on the other hand, is a very elegant solution.

I submitted a patch to the Netty project for supporting the Web Sockets protocol.

To demonstrate how to use this patch, I’ve created a little demo. This demo consists of a simple web page for sending data to the server using the Web Sockets API JavaScript API, and a simple Netty server for serving up the web page and handling the data send over the Web Socket protocol. You can download this demo from, http://people.apache.org/~mheath/websocketexample.zip. To compile it, you will need that latest version of Netty from Subversion and apply the patch I mentioned earlier.