example.js 224 Bytes Raw Blame History Permalink 1 2 3 4 5 6 7 8 9 var EventSource = require('./lib/eventsource'); var es = new EventSource('http://demo-eventsource.rhcloud.com/'); es.onmessage = function(e) { console.log(e.data); }; es.onerror = function() { console.log('ERROR!'); };