HOME

TheInfoList



OR:

Server-Sent Events (SSE) is a server push technology enabling a client to receive automatic updates from a server via an HTTP connection, and describes 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. The EventSource API is standardized as part of
HTML5 HTML5 is a markup language used for structuring and presenting content on the World Wide Web. It is the fifth and final major HTML version that is a World Wide Web Consortium (W3C) recommendation. The current specification is known as the HTML ...
by the
WHATWG The Web Hypertext Application Technology Working Group (WHATWG) is a community of people interested in evolving HTML and related technologies. The WHATWG was founded by individuals from Apple Inc., the Mozilla Foundation and Opera Software, l ...
. The
mime type A media type (also known as a MIME type) is a two-part identifier for file formats and format contents transmitted on the Internet. The Internet Assigned Numbers Authority (IANA) is the official authority for the standardization and publication o ...
for SSE is text/event-stream.


History

The SSE mechanism was first specified by
Ian Hickson Ian "Hixie" Hickson is the author and maintainer of the Acid2 and Acid3 tests, the WHATWG HTML 5 specification,
as part of the "
WHATWG The Web Hypertext Application Technology Working Group (WHATWG) is a community of people interested in evolving HTML and related technologies. The WHATWG was founded by individuals from Apple Inc., the Mozilla Foundation and Opera Software, l ...
Web Applications 1.0" proposal starting in 2004. In September 2006, the
Opera web browser Opera is a multi-platform web browser developed by its namesake company Opera. The browser is based on Chromium, but distinguishes itself from other Chromium-based browsers ( Chrome, Edge, etc.) through its user interface and other features. ...
implemented the experimental technology in a feature called "Server-Sent Events".Stream Updates with Server-Sent Events, Eric Bidelman, HTML5Rocks website.
/ref>


Browser support

All modern browsers support server-sent events:
Firefox Mozilla Firefox, or simply Firefox, is a free and open-source web browser developed by the Mozilla Foundation and its subsidiary, the Mozilla Corporation. It uses the Gecko rendering engine to display web pages, which implements current ...
6+,
Google Chrome Google Chrome is a cross-platform web browser developed by Google. It was first released in 2008 for Microsoft Windows, built with free software components from Apple WebKit and Mozilla Firefox. Versions were later released for Linux, macOS, ...
6+,
Opera Opera is a form of theatre in which music is a fundamental component and dramatic roles are taken by singers. Such a "work" (the literal translation of the Italian word "opera") is typically a collaboration between a composer and a libr ...
11.5+,
Safari A safari (; ) is an overland journey to observe wild animals, especially in eastern or southern Africa. The so-called "Big Five" game animals of Africa – lion, leopard, rhinoceros, elephant, and Cape buffalo – particularly form an impor ...
5+,
Microsoft Edge Microsoft Edge is a proprietary, cross-platform web browser created by Microsoft. It was first released in 2015 as part of Windows 10 and Xbox One and later ported to other platforms as a fork of Google's Chromium open-source project: Android ...
79+.When can I use... Server-sent DOM events
/ref>


Libraries


.NET


Service Stack
EventSource library with both server and client implementations.


ASP.NET


SignalR
- Transparent implementation for ASP.NET.


C



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


Erlang


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


Go


eventsource
EventSource library for Go.
go-sse
SSE implementation for Go.
sse
SSE with optimized decoder for Go
gosse
Server-sided implementation with channel concept and further features for out-of-the-box use.


Java


Javalin
- lightweight Java and Kotlin web framework
jEaSSE
- Server-side asynchronous implementation for Java servlets and Vert.x

since version 10.0.8

EventSource library for alpakka which supports reconnection

Server and client side Java implementation built on reactive streams and non-blocking servers

has a full implementation of
JAX-RS Jakarta RESTful Web Services, (JAX-RS; formerly Java API for RESTful Web Services) is a Jakarta EE API specification that provides support in creating web services according to the Representational State Transfer (REST) architectural pattern. ...
support for Server Sent Events as defined i
JSR-370


HTTP server supports emitting Server Sent Events
JeSSE
- Server-side library with user/session management, group broadcast, and authentication

has server and client-side asynchronous SSE implementation built on top of Netty and Reactive Streams

Event Source for server-sent event emission
SSE Client
SSE Client library


Node.js


sse-stream
-
Node.js Node.js is an open-source server environment. Node.js is cross-platform and runs on Windows, Linux, Unix, and macOS. Node.js is a back-end JavaScript runtime environment. Node.js runs on the V8 JavaScript Engine and executes JavaScript cod ...
/
Browserify Browserify is an open-source JavaScript bundler tool that allows developers to write and use Node.js Node.js is an open-source server environment. Node.js is cross-platform and runs on Windows, Linux, Unix, and macOS. Node.js is a back-end ...
implementation (client and server).
total.js
- web application framework for Node.js
example
+ supports WebSockets (RFC 6455)
eventsource-node
- EventSource client for Node.js
Thread-SSE
- A library for Node.js and web browser to develop security and high-performance SSE.


Objective C


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


Perl


Mojolicious
- Perl real-time web framework.


PHP


Hoa\Eventsource
- Server implementation.


Python


SSE Package
- Modern EventSource library written in Python3.10.
Python SSE Client
- EventSource client library for Python using Requests library.
Server Side Events (SSE) client for Python
- EventSource client library for Python using Requests or urllib3 library.
django-eventstream
- Server-Sent Events for Django.
flask-sse
- A simple Flask extension powered by Redis.
sse

SSE protocol for Starlette
- Server sent events for starlette and FastApi.
event-source-library
- Implementation in python2 with Tornado. Client and server implementations.
aiohttp-sse
- Server-sent events support for aiohttp.


Ruby


Faye
- Simple pub/sub messaging for the web.


Rust


Warp
A web server framework.


Scala



since version 10.0.8

EventSource library fo

which supports reconnection


Swift


EventSource
- EventSource implementation using NSURLSession.


See also

*
Chunked transfer encoding Chunked transfer encoding is a streaming data transfer mechanism available in Hypertext Transfer Protocol (HTTP) version 1.1, defined in RFC 9112 §7.1. In chunked transfer encoding, the data stream is divided into a series of non-overlapping " ...
*
Push technology Push technology or server push is a style of Internet-based communication where the request for a given transaction is initiated by the publisher or central server. It is contrasted with pull/get, where the request for the transmission of informa ...
*
Comet A comet is an icy, small Solar System body that, when passing close to the Sun, warms and begins to release gases, a process that is called outgassing. This produces a visible atmosphere or coma, and sometimes also a tail. These phenomena ...


References


External links


Server-Sent Events
HTML Living Standard.
HTML5 Server-push Technologies, Part 1
Introduction into HTML5 Server-push Technologies. Part 1 covers ServerSent Events.
Using Server-Sent Events
A concise example of how to use server-sent events, on the Mozilla Developer Network.
EventSource reference on MDNDjango push: Using Server-Sent Events and WebSocket with Django
Django push: Using Server-Sent Events and WebSocket with Django.
Server-Sent Events Example in SpringServer-Sent Events vs WebSockets
HTML5 Internet terminology Push technology Web development {{Internet-stub