First implementations of Web Sockets
Ajax has enabled developers to make several improvements to their web applications, but it is not the last word on the matter. Under Ajax all communication is still initiated by the browser. Web Sockets, a proposal by the World Wide Web Consortium (W3C), is intended to offer a true bi-directional connection. Interested users can now experiment with the first implementation of the technology.
To experiment with Web Sockets, in addition to the browser-side APIs, developers will also need a suitable server. Google has already provided a Python application for the purpose, which can be used either as a stand alone web server or as an Apache module.
Applications which use the Web Sockets API open a permanent connection between the browser and server. As with Ajax, when a message is received by the browser, it triggers an event which is processed by an event handler. One difference from the current technology is that the server can send data over the connection at any time without having been requested to do so by a browser
POST request. After an
open request, the channel then remains open until an explicit
close request is sent.
Rather than using HTTP, Web Sockets uses a new protocol. This should be less garrulous, as after specifying connection parameters it dispenses with the exchange of repetitive headers.