This library implements the EventSource client for Node.js. The API aims to be W3C compatible.
npm install eventsource
var EventSource = require('eventsource');
es = new EventSource('http://googlecodesamples.com/html5/sse/sse.php');
es.onmessage = function(e) {
console.log(e.data);
};
es.onerror = function() {
console.log('ERROR!');
};
See the spec for API docs.