Skip to content

Latest commit

 

History

History
29 lines (19 loc) · 709 Bytes

README.md

File metadata and controls

29 lines (19 loc) · 709 Bytes

Build Status

EventSource

This library implements the EventSource client for Node.js. The API aims to be W3C compatible.

Install

npm install eventsource

Usage

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.

Example

See https://github.com/einaros/sse-example