I checked out Socket.IO but ended up using Faye instead. Faye is probably a little more functionality than you want, but it's so easy to setup and use. I found it more intuitive than Socket.IO. Not that Socket.IO looks tough, but Faye just looked easier.
Here is the website:
There is a google users group too and the author has responded to a couple of my inquiries.
What you would need is the following code:
Node side:
var faye = require('faye');
var faye_server = new faye.NodeAdapter({mount: '/faye', timeout: 120});
console.log('Firing up faye server. . . ');
faye_server.listen(8089);
//send message out every 1 second
setInterval( function()
{
var currentTime_secsSinceEpoch = new Date().getTime() / 1000;
faye_server.getClient().publish('/heartbeat',
{
pageName: 'app.js',
timeMessageSent_secs_since_epoch: currentTime_secsSinceEpoch,
iFrame1CycleCount: iFrame1CycleCount
});
}, 1000);
Browser Side:
<script type='text/javascript'>
//create faye client
var faye_client = new Faye.Client('http://127.0.0.1:8089/faye');
var faye_message_subscription = faye_client.subscribe('/heartbeat', function(message)
{
//record the time message was received
var receiveTime_secSinceEpoch = new Date().getTime() / 1000;
console.log("Got heartbeat at " + receiveTime_secsSinceEpoch + "with a delay of " +
receiveTime_secsSinceEpoch - message.currentTime_secsSinceEpoch + " secs");
//Do something else important here!!
}
</script>
That's it! Now every time your server sends the 'heartbeat' message, your webpage will call the function we specified and spit out a message to the console. Dead simple.
Faye has a lot of other cool functionality you may want to use, but this is mostly what you will want I think.
You can attach Faye to an express server in node too really easily which makes it work really well with a webserver.