Grizzly and WebSockets

As HTML5 lumbers its way through the standardization process, more and more developers are starting to play with the emerging features.  One feature getting some serious attention is that of the websocket.  Full details of the websocket protocol can be found here but I'll lay out the basics of it.  Essentially a websocket is a TCP based socket that can be opened from a webpage via, typically, javascript code allowing bidirectional communication between the browser and the server.  This allows for comet-like interactions but with an extra benefit (or two).  Once the websocket connection is established there are no more protocol negotiations and handshakes unlike your typical AJAX conversations.  And unlike (most?) comet implementations, a websocket can process multiple requests from the client.  Obviously, this can lead to some rather interesting use cases. It's early yet so support for websockets on either end of the browser/server connection is spotty at best.  But we're staring to see browser support emerge and a number of server side options are popping up as well.  This morning I committed an early rough draft, if you will, for support inside the grizzly project and soon glassfish itself.  It's a mostly complete implementation and is ready for some experimentation.  At the moment, the sample in the unit tests that will be of the most interest is a servlet based approach.  What's nice about the current approach is that the servlet is largely unaware that it's involved in a websocket transaction at all.  There's a lot of value in something like that but might limit some other, more powerful, use cases.

For now, though, you can play with the unit tests and see what can be done.  It's preliminary but working and the API will evolve as we get feedback from the community.  We'll be discussing how best to expose this functionality without needing to know all that much about grizzly internals.  We'll be looking at other cases such as jetty and atmosphere to make sure we can provide a smooth, useful API that most people are comfortable with.  There's been talk at various levels of building some form of standard interface to plug in to various websockets implementations on the server side but until then, we'd love your help in building something with grizzly and glassfish that we can all use.

So please join us on the mailing lists and give us a hand.