Introduction
HTTP was not made for the kind of real-time web applications that many developers are creating today. As a result, all sorts of workarounds have been discovered to mimic the idea of bi-directional, uninterrupted communication between servers and clients.
WebSockets don't mimic this behavior, they provide it. A WebSocket works by stripping down an HTTP connection so it becomes a persistent TCP-like exchange, thus removing all the overhead and restrictions HTTP introduces.
The HTTP connection is stripped (or rather upgraded) when both the browser and server support WebSockets. The browser discovers this by communicating with the server via GET headers. Only newer browsers (IE10+, Google Chrome 14, Safari 5, Firefox 6) support WebSockets.
WebSockets is a new protocol. JavaScript combined with the Node framework is often versatile and low level enough to implement protocols from scratch, or failing that C/C++ modules can be written to handle more obscure or revolutionary logic. Thankfully...