Socket.IO makes writing realtime, web and mobile apps possible, without having to worry about the details of the transport mechanism. Socket.io automatically selects the most capable transport at runtime, be it WebSockets, an Adobe Flash Socket, AJAX long polling, AJAX multipart streaming, Forever Iframe, or JSONP polling. What this means to you, is that you can easily and almost instantly emit messages between client and server, listen for them, and respond. This even works cross-domain.
Installing Socket.IO on your server is the first step. This tutorial assumes that you have already installed Node.js, which includes npm. If you haven’t done that, you should read our tutorial on installing Node.js on Ubuntu 12.04 LTS.
Install the the server-side component using npm, like this:
root@nodepod:~# npm install socket.io