This month, In have been delving into Push architectures for the Web, looking into WebSockets among several other things. WebSockets, a fairly new standard (!) evolved along with HTML 5, specifies a communication protocol that provides an alternative to classic HTTP communication. WebSocket based interaction has lower overhead and – more importantly – is bi-directional which means that push from server to client is really supported (and not just emulated through poll, long poll or streaming responses as is currently the case in comet push style frameworks).
All modern browsers provide support for the WebSocket specification – meaning they can communicate based on the WebSocket protocol (ws:// and wss:// in addition to http:// and https://) and they implement the WebSocket client side (JavaScript) APIs. These API are well defined – http://dev.w3.org/html5/websockets/ – and seem to be truly standard across all browsers.
The WebSocket server side is at this moment not very well defined. Other than the fact that the communication over ws:// and wss:// should be handled by a server, not much has been decided about the server side of WebSockets. Currently, WebSockets is not supported in classic JEE servers although such support seems imminent with JEE 7 through the Servlet 3.1 specification (JSR 340, http://jcp.org/en/jsr/summary?id=340; also read http://antwerkz.com/websockets-and-java-ee/ on how WebSockets my be included in the Servlet API). Initial support for WebSockets has been shown in Jetty and GlassFish, with other JEE containers undoubtedly following suit in next 18 months or so. In the meanwhile, several stand alone WebSocket servers have been released, including Kaazing (a commercial offering which I mentioned in two earlier articles: https://technology.amis.nl/blog/14755/get-going-with-kaazing-websocket-gateway-html5-edition-installing-locally-and-running-demos and https://technology.amis.nl/blog/14777/push-based-synchronized-slideshow-web-application-implemented-using-websockets-and-kaazing-websocket-gateway) and jWebSocket (an open source offering – http://jwebsocket.org/), that I will introduce in this article.
