Server-sent events

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search

Server-Sent Events (SSE) is a server push technology enabling a client to receive 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[edit]

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[edit]

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[edit]

Web browser support for Server-Sent Events
Browser Supported Notes
Internet Explorer No [5]
Mozilla Firefox Yes Starting with Firefox 6.0 [5]
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 Yes Starting with Edge 75 [5]

Libraries[edit]

.NET[edit]

  • Service Stack EventSource library with both server and client implementations.

ASP.NET[edit]

  • SignalR - Transparent implementation for ASP.NET.

C[edit]

  • HaSSEs Asynchronous server-side SSE daemon written in C (It uses one thread for all connected clients).

Erlang[edit]

  • Lasse EventSource server handler for Erlang's cowboy
  • Shotgun EventSource client in Erlang

Go[edit]

Java[edit]

  • jEaSSE - Server-side asynchronous implementation for Java servlets and Vert.x
  • Akka HTTP has SSE support since version 10.0.8
  • alpakka Event Source Connector EventSource library for alpakka which supports reconnection
  • Spring WebFlux Server and client side Java implementation built on reactive streams and non-blocking servers
  • Jersey has a full implementation of JAX-RS support for Server Sent Events as defined in JSR-370
  • Micronaut HTTP server supports emitting Server Sent Events
  • JeSSE - Server-side library with user/session management, group broadcast, and authentication
  • Armeria has server and client-side asynchronous SSE implementation built on top of Netty and Reactive Streams

Node.js[edit]

Objective C[edit]

  • TRVSEventSource - EventSource implementation in Objective-C for iOS and macOS using NSURLSession.

Perl[edit]

PHP[edit]

Python[edit]

Scala[edit]

Swift[edit]

  • EventSource - EventSource implementation using NSURLSession

See also[edit]

References[edit]

  1. ^ "Server-Sent Events". W3C. 17 July 2013.
  2. ^ "Web Applications 1.0 specification".
  3. ^ "Event Streaming to Web Browsers".
  4. ^ Stream Updates with Server-Sent Events, Eric Bidelman, HTML5Rocks website.
  5. ^ a b c d e f When can I use... Server-sent DOM events

External links[edit]