Server-sent events
Server-sent events (SSE) is a technology where a browser receives automatic updates from a server via HTTP connection. The Server-Sent Events EventSource API is standardized as part of HTML5[1] by the W3C.
History
The WHATWG Web Applications 1.0 proposal[2] included a mechanism to push content to the client. On September 1, 2006, the Opera web browser implemented this new experimental technology in a feature called "Server-Sent Events".[3][4]
Overview
Server-sent events is a standard describing how servers can initiate data transmission towards clients once an initial client connection has been established. They are commonly used to send message updates or continuous data streams to a browser client and designed to enhance native, cross-browser streaming through a JavaScript API called EventSource, through which a client requests a particular URL in order to receive an event stream.
Web browsers
Browser | Supported | Notes |
---|---|---|
Internet Explorer | No | [5] |
Mozilla Firefox | Yes | Starting with Firefox 6.0 [6] |
Google Chrome | Yes | Starting with Chrome 6 [5] |
Opera | Yes | Starting with Opera 11 [5] |
Safari | Yes | Starting with Safari 5.0 [5] |
Microsoft Edge | No | Under consideration [5] |
Libraries
- jEaSSE - Server-side asynchronous implementation for Java servlets and Vert.x
- EventSource - Server-sent events EventSource implementation in Swift using NSURLSession
- TRVSEventSource - Server-sent events EventSource implementation in Objective-C for iOS and OS X using NSURLSession.
- django-sse - HTML5 Server-Sent Events integration for Python/Django. (replaced by asyncio)
- asyncio - asyncio is a module for Python 3.3. Since Python 3.4, asyncio is part of the standard library.
- flask-sse - A simple Flask extension for HTML5 server-sent events support, powered by Redis.
- sse - Server Sent Events protocol implementation on python2 and python3 in the same codebase.
- event-source-library - Server Sent Events protocol implementation in python2 with Tornado. Client and server implementations.
- SignalR - Transparent implementation for ASP.NET.
- Mojolicious - Perl real-time web framework.
- Hoa\Eventsource - PHP Server-Sent Events implementation.
- sse-stream - Node.js/Browserify Server-Sent Events implementation (client and server).
- total.js - web application framework for node.js - Server-Sent Events example + supports WebSockets (RFC 6455)
- eventsource-node - EventSource client for Node.js
- eventsource EventSource library for Go.
- akka-sse EventSource library for akka-http.
- Lasse EventSource server handler for Erlang's cowboy
- Shotgun EventSource client in Erlang
See also
References
- ↑ "Server-Sent Events". W3C. 17 July 2013.
- ↑ "Web Applications 1.0 specification".
- ↑ "Event Streaming to Web Browsers".
- ↑ Stream Updates with Server-Sent Events, Eric Bidelman, HTML5Rocks website.
- 1 2 3 4 5 When can I use... Server-sent DOM events
- ↑ Bug 338583 - Add support for Server-Sent DOM Events (Remote Events)
External links
- Server-Sent Events. W3C Recommendation.
- HTML5 Server-push Technologies, Part 1. Introduction into HTML5 Server-push Technologies. Part 1 covers ServerSent Events.
- Using server-sent events. Concise example how to use server-sent events, on the Mozilla Developer Network.
- Django push: Using Server-Sent Events and WebSocket with Django Django push: Using Server-Sent Events and WebSocket with Django.