Server-sent events
Widely available
The EventSource
API creates a connection to a server and listens to a stream of events sent by the server.
To learn more, see
EventSource,
EventSource: EventSource() constructor,
EventSource: close() method,
EventSource: error event,
EventSource: message event,
EventSource: open event,
EventSource: readyState property,
EventSource: url property,
EventSource: withCredentials property at MDN.
Compatibility (view on caniuse.com)
- Chrome 6 Released on 2010-09-02
- Chrome Android 18 Released on 2012-06-27
- Edge 79 Released on 2020-01-15
- Firefox 6 Released on 2011-08-16
- Firefox for Android 45 Released on 2016-03-08
- Safari 5 Released on 2010-06-07
- Safari on iOS 5 Released on 2011-10-12
Specifications
- HTML Standard (#server-sent-events), from HTML Workstream (WHATWG).