Also known as SSE, server-sent events protocol
web push technology
HTML Standard
html.spec.whatwg.org →To enable servers to push data to web pages over HTTP or using dedicated server-push protocols, this specification introduces the EventSource interface. Using this API consists of creating an EventSource object and registering an event listener. On the server-side, the script (" updates.cgi " in this case) sends messages in the following form, with the text/event-stream MIME type: Authors can separate events by using different event types. Here is a stream that has two event types, "add" and "remove": Event streams are always decoded as UTF-8. There is no way to specify another character encoding. Event stream requests can be redirected using HTTP 301 and 307 redirects as with normal HTTP requests. Clients will reconnect if the connection is closed; a client can be told to stop reconnecting using the HTTP 204 No Content response code. Using this API rather than emulating it using XMLHttpRequest or an iframe allows the user agent to make better use of network resources in cases where the user agent implementer and the network operator are able to coordinate in advance. Amongst other benefits, this can result in significant savings in battery life on portable devices. This is discussed further in the section below on connectionless push . A last event ID string. This must initially be the empty string. Apart from url these are not currently exposed on the EventSource object. url is a string giving the URL that will provide the event stream. EventSource/close method of the EventSource interface closes the connection, if one is made, and sets the EventSource.readyState attribute to 2 (closed).") Aborts any instances of the fetch algorithm started for this EventSource object, and sets the readyState attribute to CLOSED . Returns true if the credentials mode for connection requests to the URL providing the event stream is set to " include ", and false otherwise. Returns the state of this EventSource object's connection. It can have the values described below. 8. Let request be the result of creating a potential-CORS request given urlRecord, the empty string, and corsAttributeState. 15. Fetch request, with processResponseEndOfBody set to processEventSourceEndOfBody and processResponse set to the following steps given response res: 4. Otherwise, announce the connection and interpret res's body line by line. The url attribute's getter must return the serialization of this EventSource object's url . The withCredentials attribute must return the value to which it was last initialized. When the object is created, it must be initialized to false. The readyState attribute represents the state of the connection. It can have the following values: The connection has not yet been established, or it was closed and the user agent is reconnecting. The connection is not open, and the user agent is not trying to reconnect. Either there was a fatal error or the close() method was invoked. When the object is created, its readyState must be set to CONNECTING (0). The rules given below for handling the connection define when the value changes. The close() method must abort any instances of the fetch algorithm started for this EventSource object, and must set the readyState attribute to CLOSED . onopen ✔ MDN EventSource/open event Support in all current engines. Firefox6+Safari5+Chrome6+ Opera12+Edge79+ Edge (Legacy)?Internet ExplorerNo Firefox Android45+Safari iOS5+Chrome Android?WebView Android?Samsung Internet?Opera Android12+ open onmessage ✔ MDN EventSource/message event Support in all current engines. Firefox6+Safari5+Chrome6+ Opera12+Edge79+ Edge (Legacy)?Internet ExplorerNo Firefox Android45+Safari iOS5+Chrome Android?WebView Android?Samsung Internet?Opera Android12+ message onerror ✔ MDN EventSource/error event Support in all current engines. Firefox6+Safari5+Chrome6+ Opera12+Edge79+ Edge (Legacy)?Internet ExplorerNo Firefox Android45+Safari iOS5+Chrome Android?WebView Android?Samsung Internet?Opera Android12+ error 3. O
Excerpt from a page describing this subject · 40,000 chars · not written by Vinony
via Wikidata · CC0
Discovered by embedding cosine similarity (sentence-transformers MiniLM, 384-dim).