[1]WHATWG
HTML
Living Standard — Last Updated 18 June 2025 [2]← 9 Communication — [3]Table of Contents — [4]9.3 Cross-document messaging → 1. 1. [5]9.2 Server-sent events 1. [6]9.2.1 Introduction 2. [7]9.2.2 The EventSource interface 3. [8]9.2.3 Processing model 4. [9]9.2.4 The `Last-Event-ID` header 5. [10]9.2.5 Parsing an event stream 6. [11]9.2.6 Interpreting an event stream 7. [12]9.2.7 Authoring notes 8. [13]9.2.8 Connectionless push and other features 9. [14]9.2.9 Garbage collection 10. [15]9.2.10 Implementation advice
9.2 Server-sent events
(BUTTON) ✔MDN
[16]Server-sent_events
Support in all current engines. Firefox6+Safari5+Chrome6+ __________________________________________________________________
Opera11+Edge79+ __________________________________________________________________
Edge (Legacy)?Internet ExplorerNo __________________________________________________________________
Firefox Android45+Safari iOS5+Chrome Android?WebView Android?Samsung Internet?Opera Android11+
9.2.1 Introduction
This section is non-normative.
To enable servers to push data to web pages over HTTP or using dedicated server-push protocols, this specification introduces the [17]EventSource interface.
Using this API consists of creating an [18]EventSource object and registering an event listener. var source = new EventSource(ʼupdates.cgiʼ); source.onmessage = function (event) { alert(event.data); };
On the server-side, the script ("updates.cgi" in this case) sends messages in the following form, with the [19]text/event-stream MIME type: data: This is the first message.
data: This is the second message, it data: has two lines.
data: This is the third message. __________________________________________________________________
Authors can separate events by using different event types. Here is a stream that has two event types, "add" and "remove": event: add data: 73857293
event: remove data: 2153
event: add data: 113411
The script to handle such a stream would look like this (where addHandler and removeHandler are functions that take one argument, the event): var source = new EventSource(ʼupdates.cgiʼ); source.addEventListener(ʼaddʼ, addHandler, false); source.addEventListener(ʼremoveʼ, removeHandler, false);
The default event type is "message".
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 [20]XMLHttpRequest or an [21]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 [22]connectionless push.
9.2.2 The [23]EventSource interface
(BUTTON) ✔MDN
[24]EventSource
Support in all current engines. Firefox6+Safari5+Chrome6+ __________________________________________________________________
Opera11+Edge79+ __________________________________________________________________
Edge (Legacy)?Internet ExplorerNo __________________________________________________________________
Firefox Android45+Safari iOS5+Chrome Android?WebView Android?Samsung Internet?Opera Android11+
[Exposed=(Window,Worker)] interface EventSource : [25]EventTarget { [26]constructor(USVString url, optional [27]EventSourceInit eventSourceInitDic t = {});
readonly attribute USVString [28]url; readonly attribute boolean [29]withCredentials;
// ready state const unsigned short [30]CONNECTING = 0; const unsigned short [31]OPEN = 1; const unsigned short [32]CLOSED = 2; readonly attribute unsigned short [33]readyState;
// networking attribute [34]EventHandler [35]onopen; attribute [36]EventHandler [37]onmessage; attribute [38]EventHandler [39]onerror; undefined [40]close(); };
dictionary EventSourceInit { boolean withCredentials = false; };
Each [41]EventSource object has the following associated with it: * A url (a [42]URL record). Set during construction. * A request. This must initially be null. * A reconnection time, in milliseconds. This must initially be an [43]implementation-defined value, probably in the region of a few seconds. * A last event ID string. This must initially be the empty string.
Apart from [44]url these are not currently exposed on the [45]EventSource object.
source = new [46]EventSource( url [, { [47]withCredentials: true } ])
(BUTTON) ✔MDN
[48]EventSource/EventSource
Support in all current engines.
Firefox6+Safari5+Chrome6+ ___________________________________________________________
Opera11+Edge79+ ___________________________________________________________
Edge (Legacy)?Internet ExplorerNo ___________________________________________________________
Firefox Android45+Safari iOS5+Chrome Android?WebView Android?Samsung Internet?Opera Android12+ Creates a new [49]EventSource object.
url is a string giving the [50]URL that will provide the event stream.
Setting [51]withCredentials to true will set the [52]credentials mode for connection requests to url to "include".
source.[53]close()
(BUTTON) ✔MDN
[54]EventSource/close
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+ Aborts any instances of the [55]fetch algorithm started for this [56]EventSource object, and sets the [57]readyState attribute to [58]CLOSED.
source.[59]url
(BUTTON) ✔MDN
[60]EventSource/url
Support in all current engines.
Firefox6+Safari6+Chrome18+ ___________________________________________________________
Opera12+Edge79+ ___________________________________________________________
Edge (Legacy)?Internet ExplorerNo ___________________________________________________________
Firefox Android45+Safari iOS?Chrome Android?WebView Android?Samsung Internet?Opera Android12+ Returns the [61]URL providing the event stream.
source.[62]withCredentials
(BUTTON) ✔MDN
[63]EventSource/withCredentials
Support in all current engines.
Firefox6+Safari7+Chrome26+ ___________________________________________________________
Opera12+Edge79+ ___________________________________________________________
Edge (Legacy)?Internet ExplorerNo ___________________________________________________________
Firefox Android45+Safari iOS?Chrome Android?WebView Android?Samsung Internet?Opera Android12+ Returns true if the [64]credentials mode for connection requests to the [65]URL providing the event stream is set to "include", and false otherwise.
source.[66]readyState
(BUTTON) ✔MDN
[67]EventSource/readyState
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+ Returns the state of this [68]EventSource object's connection. It can have the values described below.
The EventSource(url, eventSourceInitDict) constructor, when invoked, must run these steps: 1. Let ev be a new [69]EventSource object. 2. Let settings be ev's [70]relevant settings object. 3. Let urlRecord be the result of [71]encoding-parsing a URL given url, relative to settings. 4. If urlRecord is failure, then throw a [72]"SyntaxError" [73]DOMException. 5. Set ev's [74]url to urlRecord. 6. Let corsAttributeState be [75]Anonymous. 7. If the value of eventSourceInitDict's [76]withCredentials member is true, then set corsAttributeState to [77]Use Credentials and set ev's [78]withCredentials attribute to true. 8. Let request be the result of [79]creating a potential-CORS request given urlRecord, the empty string, and corsAttributeState. 9. Set request's [80]client to settings. 10. User agents may [81]set (`[82]Accept`, `[83]text/event-stream`) in request's [84]header list. 11. Set request's [85]cache mode to "no-store". 12. Set request's [86]initiator type to "other". 13. Set ev's [87]request to request. 14. Let processEventSourceEndOfBody given [88]response res be the following step: if res is not a [89]network error, then [90]reestablish the connection. 15. [91]Fetch request, with [92]processResponseEndOfBody set to processEventSourceEndOfBody and [93]processResponse set to the following steps given [94]response res: 1. If res is an [95]aborted network error, then [96]fail the connection. 2. Otherwise, if res is a [97]network error, then [98]reestablish the connection, unless the user agent knows that to be futile, in which case the user agent may [99]fail the connection. 3. Otherwise, if res's [100]status is not 200, or if res's `[101]Content-Type` is not `[102]text/event-stream`, then [103]fail the connection. 4. Otherwise, [104]announce the connection and [105]interpret res's [106]body line by line. 16. Return ev. __________________________________________________________________
The url attribute's getter must return the [107]serialization of this [108]EventSource object's [109]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:
CONNECTING (numeric value 0) The connection has not yet been established, or it was closed and the user agent is reconnecting.
OPEN (numeric value 1) The user agent has an open connection and is dispatching events as it receives them.
CLOSED (numeric value 2) The connection is not open, and the user agent is not trying to reconnect. Either there was a fatal error or the [110]close() method was invoked.
When the object is created its [111]readyState must be set to [112]CONNECTING (0). The rules given below for handling the connection define when the value changes.
The close() method must abort any instances of the [113]fetch algorithm started for this [114]EventSource object, and must set the [115]readyState attribute to [116]CLOSED.
The following are the [117]event handlers (and their corresponding [118]event handler event types) that must be supported, as [119]event handler IDL attributes, by all objects implementing the [120]EventSource interface:
[121]Event handler [122]Event handler event type onopen (BUTTON) ✔MDN
[123]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+ [124]open onmessage (BUTTON) ✔MDN
[125]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+ [126]message onerror (BUTTON) ✔MDN
[127]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+ [128]error __________________________________________________________________
9.2.3 Processing model
When a user agent is to announce the connection, the user agent must [129]queue a task which, if the [130]readyState attribute is set to a value other than [131]CLOSED, sets the [132]readyState attribute to [133]OPEN and [134]fires an event named [135]open at the [136]EventSource object.
When a user agent is to reestablish the connection, the user agent must run the following steps. These steps are run [137]in parallel, not as part of a [138]task. (The tasks that it queues, of course, are run like normal tasks and not themselves [139]in parallel.) 1. [140]Queue a task to run the following steps: 1. If the [141]readyState attribute is set to [142]CLOSED, abort the task. 2. Set the [143]readyState attribute to [144]CONNECTING. 3. [145]Fire an event named [146]error at the [147]EventSource object. 2. Wait a delay equal to the reconnection time of the event source. 3. Optionally, wait some more. In particular, if the previous attempt failed, then user agents might introduce an exponential backoff delay to avoid overloading a potentially already overloaded server. Alternatively, if the operating system has reported that there is no network connectivity, user agents might wait for the operating system to announce that the network connection has returned before retrying. 4. Wait until the aforementioned task has run, if it has not yet run. 5. [148]Queue a task to run the following steps: 1. If the [149]EventSource object's [150]readyState attribute is not set to [151]CONNECTING, then return. 2. Let request be the [152]EventSource object's [153]request. 3. If the [154]EventSource object's [155]last event ID string is not the empty string, then: 1. Let lastEventIDValue be the [156]EventSource object's [157]last event ID string, [158]encoded as UTF-8. 2. [159]Set (`[160]Last-Event-ID`, lastEventIDValue) in request's [161]header list. 4. [162]Fetch request and process the response obtained in this fashion, if any, as described earlier in this section.
When a user agent is to fail the connection, the user agent must [163]queue a task which, if the [164]readyState attribute is set to a value other than [165]CLOSED, sets the [166]readyState attribute to [167]CLOSED and [168]fires an event named [169]error at the [170]EventSource object. Once the user agent has [171]failed the connection, it does not attempt to reconnect. __________________________________________________________________
The [172]task source for any [173]tasks that are [174]queued by [175]EventSource objects is the remote event task source.
9.2.4 The `[176]Last-Event-ID` header
The Last-Event-ID` HTTP request header reports an [177]EventSource object's [178]last event ID string to the server when the user agent is to [179]reestablish the connection.
See [180]whatwg/html issue #7363 to define the value space better. It is essentially any UTF-8 encoded string, that does not contain U+0000 NULL, U+000A LF, or U+000D CR.
9.2.5 Parsing an event stream
This event stream format's [181]MIME type is [182]text/event-stream.
The event stream format is as described by the stream production of the following ABNF, the character set for which is Unicode. [183][ABNF] stream = [ bom ] *event event = *( comment / field ) end-of-line comment = colon *any-char end-of-line field = 1*name-char [ colon [ space ] *any-char ] end-of-line end-of-line = ( cr lf / cr / lf )
; characters lf = %x000A ; U+000A LINE FEED (LF) cr = %x000D ; U+000D CARRIAGE RETURN (CR) space = %x0020 ; U+0020 SPACE colon = %x003A ; U+003A COLON (:) bom = %xFEFF ; U+FEFF BYTE ORDER MARK name-char = %x0000-0009 / %x000B-000C / %x000E-0039 / %x003B-10FFFF ; a [184]scalar value other than U+000A LINE FEED (LF), U+000D C ARRIAGE RETURN (CR), or U+003A COLON (:) any-char = %x0000-0009 / %x000B-000C / %x000E-10FFFF ; a [185]scalar value other than U+000A LINE FEED (LF) or U+000D CARRIAGE RETURN (CR)
Event streams in this format must always be encoded as UTF-8. [186][ENCODING]
Lines must be separated by either a U+000D CARRIAGE RETURN U+000A LINE FEED (CRLF) character pair, a single U+000A LINE FEED (LF) character, or a single U+000D CARRIAGE RETURN (CR) character.
Since connections established to remote servers for such resources are expected to be long-lived, UAs should ensure that appropriate buffering is used. In particular, while line buffering with lines are defined to end with a single U+000A LINE FEED (LF) character is safe, block buffering or line buffering with different expected line endings can cause delays in event dispatch.
9.2.6 Interpreting an event stream
Streams must be decoded using the [187]UTF-8 decode algorithm.
The [188]UTF-8 decode algorithm strips one leading UTF-8 Byte Order Mark (BOM), if any.
The stream must then be parsed by reading everything line by line, with a U+000D CARRIAGE RETURN U+000A LINE FEED (CRLF) character pair, a single U+000A LINE FEED (LF) character not preceded by a U+000D CARRIAGE RETURN (CR) character, and a single U+000D CARRIAGE RETURN (CR) character not followed by a U+000A LINE FEED (LF) character being the ways in which a line can end.
When a stream is parsed, a data buffer, an event type buffer, and a last event ID buffer must be associated with it. They must be initialized to the empty string.
Lines must be processed, in the order they are received, as follows:
If the line is empty (a blank line) [189]Dispatch the event, as defined below.
If the line starts with a U+003A COLON character (:) Ignore the line.
If the line contains a U+003A COLON character (:) Collect the characters on the line before the first U+003A COLON character (:), and let field be that string.
Collect the characters on the line after the first U+003A COLON character (:), and let value be that string. If value starts with a U+0020 SPACE character, remove it from value.
[190]Process the field using the steps described below, using field as the field name and value as the field value.
Otherwise, the string is not empty but does not contain a U+003A COLON character (:) [191]Process the field using the steps described below, using the whole line as the field name, and the empty string as the field value.
Once the end of the file is reached, any pending data must be discarded. (If the file ends in the middle of an event, before the final empty line, the incomplete event is not dispatched.) __________________________________________________________________
The steps to process the field given a field name and a field value depend on the field name, as given in the following list. Field names must be compared literally, with no case folding performed.
If the field name is "event" Set the event type buffer to the field value.
If the field name is "data" Append the field value to the data buffer, then append a single U+000A LINE FEED (LF) character to the data buffer.
If the field name is "id" If the field value does not contain U+0000 NULL, then set the last event ID buffer to the field value. Otherwise, ignore the field.
If the field name is "retry" If the field value consists of only [192]ASCII digits, then interpret the field value as an integer in base ten, and set the event stream's [193]reconnection time to that integer. Otherwise, ignore the field.
Otherwise The field is ignored.
When the user agent is required to dispatch the event, the user agent must process the data buffer, the event type buffer, and the last event ID buffer using steps appropriate for the user agent.
For web browsers, the appropriate steps to [194]dispatch the event are as follows: 1. Set the [195]last event ID string of the event source to the value of the last event ID buffer. The buffer does not get reset, so the [196]last event ID string of the event source remains set to this value until the next time it is set by the server. 2. If the data buffer is an empty string, set the data buffer and the event type buffer to the empty string and return. 3. If the data buffer's last character is a U+000A LINE FEED (LF) character, then remove the last character from the data buffer. 4. Let event be the result of [197]creating an event using [198]MessageEvent, in the [199]relevant realm of the [200]EventSource object. 5. Initialize event's [201]type attribute to "[202]message", its [203]data attribute to data, its [204]origin attribute to the [205]serialization of the [206]origin of the event stream's final URL (i.e., the URL after redirects), and its [207]lastEventId attribute to the [208]last event ID string of the event source. 6. If the event type buffer has a value other than the empty string, change the [209]type of the newly created event to equal the value of the event type buffer. 7. Set the data buffer and the event type buffer to the empty string. 8. [210]Queue a task which, if the [211]readyState attribute is set to a value other than [212]CLOSED, [213]dispatches the newly created event at the [214]EventSource object.
If an event doesn't have an "id" field, but an earlier event did set the event source's [215]last event ID string, then the event's [216]lastEventId field will be set to the value of whatever the last seen "id" field was.
For other user agents, the appropriate steps to [217]dispatch the event are implementation dependent, but at a minimum they must set the data and event type buffers to the empty string before returning.
The following event stream, once followed by a blank line: data: YHOO data: +2 data: 10
...would cause an event [218]message with the interface [219]MessageEvent to be dispatched on the [220]EventSource object. The event's [221]data attribute would contain the string "YHOO\n+2\n10" (where "\n" represents a newline).
This could be used as follows: var stocks = new EventSource("https://stocks.example.com/ticker.php"); stocks.onmessage = function (event) { var data = event.data.split(ʼ\nʼ); updateStocks(data[0], data[1], data[2]); };
...where updateStocks() is a function defined as: function updateStocks(symbol, delta, value) { ... }
...or some such.
The following stream contains four blocks. The first block has just a comment, and will fire nothing. The second block has two fields with names "data" and "id" respectively; an event will be fired for this block, with the data "first event", and will then set the last event ID to "1" so that if the connection died between this block and the next, the server would be sent a `[222]Last-Event-ID` header with the value `1`. The third block fires an event with data "second event", and also has an "id" field, this time with no value, which resets the last event ID to the empty string (meaning no `[223]Last-Event-ID` header will now be sent in the event of a reconnection being attempted). Finally, the last block just fires an event with the data " third event" (with a single leading space character). Note that the last still has to end with a blank line, the end of the stream is not enough to trigger the dispatch of the last event. : test stream
data: first event id: 1
data:second event id
data: third event
The following stream fires two events: data
data data
data:
The first block fires events with the data set to the empty string, as would the last block if it was followed by a blank line. The middle block fires an event with the data set to a single newline character. The last block is discarded because it is not followed by a blank line.
The following stream fires two identical events: data:test
data: test
This is because the space after the colon is ignored if present.
9.2.7 Authoring notes
Legacy proxy servers are known to, in certain cases, drop HTTP connections after a short timeout. To protect against such proxy servers, authors can include a comment line (one starting with a ':' character) every 15 seconds or so.
Authors wishing to relate event source connections to each other or to specific documents previously served might find that relying on IP addresses doesn't work, as individual clients can have multiple IP addresses (due to having multiple proxy servers) and individual IP addresses can have multiple clients (due to sharing a proxy server). It is better to include a unique identifier in the document when it is served and then pass that identifier as part of the URL when the connection is established.
Authors are also cautioned that HTTP chunking can have unexpected negative effects on the reliability of this protocol, in particular if the chunking is done by a different layer unaware of the timing requirements. If this is a problem, chunking can be disabled for serving event streams.
Clients that support HTTP's per-server connection limitation might run into trouble when opening multiple pages from a site if each page has an [224]EventSource to the same domain. Authors can avoid this using the relatively complex mechanism of using unique domain names per connection, or by allowing the user to enable or disable the [225]EventSource functionality on a per-page basis, or by sharing a single [226]EventSource object using a [227]shared worker.
9.2.8 Connectionless push and other features
User agents running in controlled environments, e.g. browsers on mobile handsets tied to specific carriers, may offload the management of the connection to a proxy on the network. In such a situation, the user agent for the purposes of conformance is considered to include both the handset software and the network proxy.
For example, a browser on a mobile device, after having established a connection, might detect that it is on a supporting network and request that a proxy server on the network take over the management of the connection. The timeline for such a situation might be as follows: 1. Browser connects to a remote HTTP server and requests the resource specified by the author in the [228]EventSource constructor. 2. The server sends occasional messages. 3. In between two messages, the browser detects that it is idle except for the network activity involved in keeping the TCP connection alive, and decides to switch to sleep mode to save power. 4. The browser disconnects from the server. 5. The browser contacts a service on the network, and requests that the service, a "push proxy", maintain the connection instead. 6. The "push proxy" service contacts the remote HTTP server and requests the resource specified by the author in the [229]EventSource constructor (possibly including a `[230]Last-Event-ID` HTTP header, etc.). 7. The browser allows the mobile device to go to sleep. 8. The server sends another message. 9. The "push proxy" service uses a technology such as OMA push to convey the event to the mobile device, which wakes only enough to process the event and then returns to sleep.
This can reduce the total data usage, and can therefore result in considerable power savings.
As well as implementing the existing API and [231]text/event-stream wire format as defined by this specification and in more distributed ways as described above, formats of event framing defined by [232]other applicable specifications may be supported. This specification does not define how they are to be parsed or processed.
9.2.9 Garbage collection
While an [233]EventSource object's [234]readyState is [235]CONNECTING, and the object has one or more event listeners registered for [236]open, [237]message, or [238]error events, there must be a strong reference from the [239]Window or [240]WorkerGlobalScope object that the [241]EventSource object's constructor was invoked from to the [242]EventSource object itself.
While an [243]EventSource object's [244]readyState is [245]OPEN, and the object has one or more event listeners registered for [246]message or [247]error events, there must be a strong reference from the [248]Window or [249]WorkerGlobalScope object that the [250]EventSource object's constructor was invoked from to the [251]EventSource object itself.
While there is a task queued by an [252]EventSource object on the [253]remote event task source, there must be a strong reference from the [254]Window or [255]WorkerGlobalScope object that the [256]EventSource object's constructor was invoked from to that [257]EventSource object.
If a user agent is to forcibly close an [258]EventSource object (this happens when a [259]Document object goes away permanently), the user agent must abort any instances of the [260]fetch algorithm started for this [261]EventSource object, and must set the [262]readyState attribute to [263]CLOSED.
If an [264]EventSource object is garbage collected while its connection is still open, the user agent must abort any instance of the [265]fetch algorithm opened by this [266]EventSource.
9.2.10 Implementation advice
This section is non-normative.
User agents are strongly urged to provide detailed diagnostic information about [267]EventSource objects and their related network connections in their development consoles, to aid authors in debugging code using this API.
For example, a user agent could have a panel displaying all the [268]EventSource objects a page has created, each listing the constructor's arguments, whether there was a network error, what the CORS status of the connection is and what headers were sent by the client and received from the server to lead to that status, the messages that were received and how they were parsed, and so forth.
Implementations are especially encouraged to report detailed information to their development consoles whenever an [269]error event is fired, since little to no information can be made available in the events themselves. [270]← 9 Communication — [271]Table of Contents — [272]9.3 Cross-document messaging →
References
Visible links: 1. https://whatwg.org/ 2. https://html.spec.whatwg.org/multipage/comms.html 3. https://html.spec.whatwg.org/multipage/ 4. https://html.spec.whatwg.org/multipage/web-messaging.html 5. https://html.spec.whatwg.org/multipage/server-sent-events.html#server-sent-events 6. https://html.spec.whatwg.org/multipage/server-sent-events.html#server-sent-events-intro 7. https://html.spec.whatwg.org/multipage/server-sent-events.html#the-eventsource-interface 8. https://html.spec.whatwg.org/multipage/server-sent-events.html#sse-processing-model 9. https://html.spec.whatwg.org/multipage/server-sent-events.html#the-last-event-id-header 10. https://html.spec.whatwg.org/multipage/server-sent-events.html#parsing-an-event-stream 11. https://html.spec.whatwg.org/multipage/server-sent-events.html#event-stream-interpretation 12. https://html.spec.whatwg.org/multipage/server-sent-events.html#authoring-notes 13. https://html.spec.whatwg.org/multipage/server-sent-events.html#eventsource-push 14. https://html.spec.whatwg.org/multipage/server-sent-events.html#garbage-collection 15. https://html.spec.whatwg.org/multipage/server-sent-events.html#implementation-advice 16. https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events 17. https://html.spec.whatwg.org/multipage/server-sent-events.html#eventsource 18. https://html.spec.whatwg.org/multipage/server-sent-events.html#eventsource 19. https://html.spec.whatwg.org/multipage/iana.html#text/event-stream 20. https://xhr.spec.whatwg.org/#xmlhttprequest 21. https://html.spec.whatwg.org/multipage/iframe-embed-object.html#the-iframe-element 22. https://html.spec.whatwg.org/multipage/server-sent-events.html#eventsource-push 23. https://html.spec.whatwg.org/multipage/server-sent-events.html#eventsource 24. https://developer.mozilla.org/en-US/docs/Web/API/EventSource 25. https://dom.spec.whatwg.org/#interface-eventtarget 26. https://html.spec.whatwg.org/multipage/server-sent-events.html#dom-eventsource 27. https://html.spec.whatwg.org/multipage/server-sent-events.html#eventsourceinit 28. https://html.spec.whatwg.org/multipage/server-sent-events.html#dom-eventsource-url 29. https://html.spec.whatwg.org/multipage/server-sent-events.html#dom-eventsource-withcredentials 30. https://html.spec.whatwg.org/multipage/server-sent-events.html#dom-eventsource-connecting 31. https://html.spec.whatwg.org/multipage/server-sent-events.html#dom-eventsource-open 32. https://html.spec.whatwg.org/multipage/server-sent-events.html#dom-eventsource-closed 33. https://html.spec.whatwg.org/multipage/server-sent-events.html#dom-eventsource-readystate 34. https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler 35. https://html.spec.whatwg.org/multipage/server-sent-events.html#handler-eventsource-onopen 36. https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler 37. https://html.spec.whatwg.org/multipage/server-sent-events.html#handler-eventsource-onmessage 38. https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler 39. https://html.spec.whatwg.org/multipage/server-sent-events.html#handler-eventsource-onerror 40. https://html.spec.whatwg.org/multipage/server-sent-events.html#dom-eventsource-close 41. https://html.spec.whatwg.org/multipage/server-sent-events.html#eventsource 42. https://url.spec.whatwg.org/#concept-url 43. https://infra.spec.whatwg.org/#implementation-defined 44. https://html.spec.whatwg.org/multipage/server-sent-events.html#concept-eventsource-url 45. https://html.spec.whatwg.org/multipage/server-sent-events.html#eventsource 46. https://html.spec.whatwg.org/multipage/server-sent-events.html#dom-eventsource 47. https://html.spec.whatwg.org/multipage/server-sent-events.html#dom-eventsourceinit-withcredentials 48. https://developer.mozilla.org/en-US/docs/Web/API/EventSource/EventSource 49. https://html.spec.whatwg.org/multipage/server-sent-events.html#eventsource 50. https://url.spec.whatwg.org/#concept-url 51. https://html.spec.whatwg.org/multipage/server-sent-events.html#dom-eventsourceinit-withcredentials 52. https://fetch.spec.whatwg.org/#concept-request-credentials-mode 53. https://html.spec.whatwg.org/multipage/server-sent-events.html#dom-eventsource-close 54. https://developer.mozilla.org/en-US/docs/Web/API/EventSource/close 55. https://fetch.spec.whatwg.org/#concept-fetch 56. https://html.spec.whatwg.org/multipage/server-sent-events.html#eventsource 57. https://html.spec.whatwg.org/multipage/server-sent-events.html#dom-eventsource-readystate 58. https://html.spec.whatwg.org/multipage/server-sent-events.html#dom-eventsource-closed 59. https://html.spec.whatwg.org/multipage/server-sent-events.html#dom-eventsource-url 60. https://developer.mozilla.org/en-US/docs/Web/API/EventSource/url 61. https://html.spec.whatwg.org/multipage/server-sent-events.html#concept-eventsource-url 62. https://html.spec.whatwg.org/multipage/server-sent-events.html#dom-eventsource-withcredentials 63. https://developer.mozilla.org/en-US/docs/Web/API/EventSource/withCredentials 64. https://fetch.spec.whatwg.org/#concept-request-credentials-mode 65. https://html.spec.whatwg.org/multipage/server-sent-events.html#concept-eventsource-url 66. https://html.spec.whatwg.org/multipage/server-sent-events.html#dom-eventsource-readystate 67. https://developer.mozilla.org/en-US/docs/Web/API/EventSource/readyState 68. https://html.spec.whatwg.org/multipage/server-sent-events.html#eventsource 69. https://html.spec.whatwg.org/multipage/server-sent-events.html#eventsource 70. https://html.spec.whatwg.org/multipage/webappapis.html#relevant-settings-object 71. https://html.spec.whatwg.org/multipage/urls-and-fetching.html#encoding-parsing-a-url 72. https://webidl.spec.whatwg.org/#syntaxerror 73. https://webidl.spec.whatwg.org/#dfn-DOMException 74. https://html.spec.whatwg.org/multipage/server-sent-events.html#concept-eventsource-url 75. https://html.spec.whatwg.org/multipage/urls-and-fetching.html#attr-crossorigin-anonymous 76. https://html.spec.whatwg.org/multipage/server-sent-events.html#dom-eventsourceinit-withcredentials 77. https://html.spec.whatwg.org/multipage/urls-and-fetching.html#attr-crossorigin-use-credentials 78. https://html.spec.whatwg.org/multipage/server-sent-events.html#dom-eventsource-withcredentials 79. https://html.spec.whatwg.org/multipage/urls-and-fetching.html#create-a-potential-cors-request 80. https://fetch.spec.whatwg.org/#concept-request-client 81. https://fetch.spec.whatwg.org/#concept-header-list-set 82. https://httpwg.org/specs/rfc7231.html#header.accept 83. https://html.spec.whatwg.org/multipage/iana.html#text/event-stream 84. https://fetch.spec.whatwg.org/#concept-request-header-list 85. https://fetch.spec.whatwg.org/#concept-request-cache-mode 86. https://fetch.spec.whatwg.org/#request-initiator-type 87. https://html.spec.whatwg.org/multipage/server-sent-events.html#concept-event-stream-request 88. https://fetch.spec.whatwg.org/#concept-response 89. https://fetch.spec.whatwg.org/#concept-network-error 90. https://html.spec.whatwg.org/multipage/server-sent-events.html#reestablish-the-connection 91. https://fetch.spec.whatwg.org/#concept-fetch 92. https://fetch.spec.whatwg.org/#fetch-processresponseendofbody 93. https://fetch.spec.whatwg.org/#process-response 94. https://fetch.spec.whatwg.org/#concept-response 95. https://fetch.spec.whatwg.org/#concept-aborted-network-error 96. https://html.spec.whatwg.org/multipage/server-sent-events.html#fail-the-connection 97. https://fetch.spec.whatwg.org/#concept-network-error 98. https://html.spec.whatwg.org/multipage/server-sent-events.html#reestablish-the-connection 99. https://html.spec.whatwg.org/multipage/server-sent-events.html#fail-the-connection 100. https://fetch.spec.whatwg.org/#concept-response-status 101. https://html.spec.whatwg.org/multipage/urls-and-fetching.html#content-type 102. https://html.spec.whatwg.org/multipage/iana.html#text/event-stream 103. https://html.spec.whatwg.org/multipage/server-sent-events.html#fail-the-connection 104. https://html.spec.whatwg.org/multipage/server-sent-events.html#announce-the-connection 105. https://html.spec.whatwg.org/multipage/server-sent-events.html#event-stream-interpretation 106. https://fetch.spec.whatwg.org/#concept-response-body 107. https://url.spec.whatwg.org/#concept-url-serializer 108. https://html.spec.whatwg.org/multipage/server-sent-events.html#eventsource 109. https://html.spec.whatwg.org/multipage/server-sent-events.html#concept-eventsource-url 110. https://html.spec.whatwg.org/multipage/server-sent-events.html#dom-eventsource-close 111. https://html.spec.whatwg.org/multipage/server-sent-events.html#dom-eventsource-readystate 112. https://html.spec.whatwg.org/multipage/server-sent-events.html#dom-eventsource-connecting 113. https://fetch.spec.whatwg.org/#concept-fetch 114. https://html.spec.whatwg.org/multipage/server-sent-events.html#eventsource 115. https://html.spec.whatwg.org/multipage/server-sent-events.html#dom-eventsource-readystate 116. https://html.spec.whatwg.org/multipage/server-sent-events.html#dom-eventsource-closed 117. https://html.spec.whatwg.org/multipage/webappapis.html#event-handlers 118. https://html.spec.whatwg.org/multipage/webappapis.html#event-handler-event-type 119. https://html.spec.whatwg.org/multipage/webappapis.html#event-handler-idl-attributes 120. https://html.spec.whatwg.org/multipage/server-sent-events.html#eventsource 121. https://html.spec.whatwg.org/multipage/webappapis.html#event-handlers 122. https://html.spec.whatwg.org/multipage/webappapis.html#event-handler-event-type 123. https://developer.mozilla.org/en-US/docs/Web/API/EventSource/open_event 124. https://html.spec.whatwg.org/multipage/indices.html#event-open 125. https://developer.mozilla.org/en-US/docs/Web/API/EventSource/message_event 126. https://html.spec.whatwg.org/multipage/indices.html#event-message 127. https://developer.mozilla.org/en-US/docs/Web/API/EventSource/error_event 128. https://html.spec.whatwg.org/multipage/indices.html#event-error 129. https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task 130. https://html.spec.whatwg.org/multipage/server-sent-events.html#dom-eventsource-readystate 131. https://html.spec.whatwg.org/multipage/server-sent-events.html#dom-eventsource-closed 132. https://html.spec.whatwg.org/multipage/server-sent-events.html#dom-eventsource-readystate 133. https://html.spec.whatwg.org/multipage/server-sent-events.html#dom-eventsource-open 134. https://dom.spec.whatwg.org/#concept-event-fire 135. https://html.spec.whatwg.org/multipage/indices.html#event-open 136. https://html.spec.whatwg.org/multipage/server-sent-events.html#eventsource 137. https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel 138. https://html.spec.whatwg.org/multipage/webappapis.html#concept-task 139. https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel 140. https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task 141. https://html.spec.whatwg.org/multipage/server-sent-events.html#dom-eventsource-readystate 142. https://html.spec.whatwg.org/multipage/server-sent-events.html#dom-eventsource-closed 143. https://html.spec.whatwg.org/multipage/server-sent-events.html#dom-eventsource-readystate 144. https://html.spec.whatwg.org/multipage/server-sent-events.html#dom-eventsource-connecting 145. https://dom.spec.whatwg.org/#concept-event-fire 146. https://html.spec.whatwg.org/multipage/indices.html#event-error 147. https://html.spec.whatwg.org/multipage/server-sent-events.html#eventsource 148. https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task 149. https://html.spec.whatwg.org/multipage/server-sent-events.html#eventsource 150. https://html.spec.whatwg.org/multipage/server-sent-events.html#dom-eventsource-readystate 151. https://html.spec.whatwg.org/multipage/server-sent-events.html#dom-eventsource-connecting 152. https://html.spec.whatwg.org/multipage/server-sent-events.html#eventsource 153. https://html.spec.whatwg.org/multipage/server-sent-events.html#concept-event-stream-request 154. https://html.spec.whatwg.org/multipage/server-sent-events.html#eventsource 155. https://html.spec.whatwg.org/multipage/server-sent-events.html#concept-event-stream-last-event-id 156. https://html.spec.whatwg.org/multipage/server-sent-events.html#eventsource 157. https://html.spec.whatwg.org/multipage/server-sent-events.html#concept-event-stream-last-event-id 158. https://encoding.spec.whatwg.org/#utf-8-encode 159. https://fetch.spec.whatwg.org/#concept-header-list-set 160. https://html.spec.whatwg.org/multipage/server-sent-events.html#last-event-id 161. https://fetch.spec.whatwg.org/#concept-request-header-list 162. https://fetch.spec.whatwg.org/#concept-fetch 163. https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task 164. https://html.spec.whatwg.org/multipage/server-sent-events.html#dom-eventsource-readystate 165. https://html.spec.whatwg.org/multipage/server-sent-events.html#dom-eventsource-closed 166. https://html.spec.whatwg.org/multipage/server-sent-events.html#dom-eventsource-readystate 167. https://html.spec.whatwg.org/multipage/server-sent-events.html#dom-eventsource-closed 168. https://dom.spec.whatwg.org/#concept-event-fire 169. https://html.spec.whatwg.org/multipage/indices.html#event-error 170. https://html.spec.whatwg.org/multipage/server-sent-events.html#eventsource 171. https://html.spec.whatwg.org/multipage/server-sent-events.html#fail-the-connection 172. https://html.spec.whatwg.org/multipage/webappapis.html#task-source 173. https://html.spec.whatwg.org/multipage/webappapis.html#concept-task 174. https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task 175. https://html.spec.whatwg.org/multipage/server-sent-events.html#eventsource 176. https://html.spec.whatwg.org/multipage/server-sent-events.html#last-event-id 177. https://html.spec.whatwg.org/multipage/server-sent-events.html#eventsource 178. https://html.spec.whatwg.org/multipage/server-sent-events.html#concept-event-stream-last-event-id 179. https://html.spec.whatwg.org/multipage/server-sent-events.html#reestablish-the-connection 180. https://github.com/whatwg/html/issues/7363 181. https://mimesniff.spec.whatwg.org/#mime-type 182. https://html.spec.whatwg.org/multipage/iana.html#text/event-stream 183. https://html.spec.whatwg.org/multipage/references.html#refsABNF 184. https://infra.spec.whatwg.org/#scalar-value 185. https://infra.spec.whatwg.org/#scalar-value 186. https://html.spec.whatwg.org/multipage/references.html#refsENCODING 187. https://encoding.spec.whatwg.org/#utf-8-decode 188. https://encoding.spec.whatwg.org/#utf-8-decode 189. https://html.spec.whatwg.org/multipage/server-sent-events.html#dispatchMessage 190. https://html.spec.whatwg.org/multipage/server-sent-events.html#processField 191. https://html.spec.whatwg.org/multipage/server-sent-events.html#processField 192. https://infra.spec.whatwg.org/#ascii-digit 193. https://html.spec.whatwg.org/multipage/server-sent-events.html#concept-event-stream-reconnection-time 194. https://html.spec.whatwg.org/multipage/server-sent-events.html#dispatchMessage 195. https://html.spec.whatwg.org/multipage/server-sent-events.html#concept-event-stream-last-event-id 196. https://html.spec.whatwg.org/multipage/server-sent-events.html#concept-event-stream-last-event-id 197. https://dom.spec.whatwg.org/#concept-event-create 198. https://html.spec.whatwg.org/multipage/comms.html#messageevent 199. https://html.spec.whatwg.org/multipage/webappapis.html#concept-relevant-realm 200. https://html.spec.whatwg.org/multipage/server-sent-events.html#eventsource 201. https://dom.spec.whatwg.org/#dom-event-type 202. https://html.spec.whatwg.org/multipage/indices.html#event-message 203. https://html.spec.whatwg.org/multipage/comms.html#dom-messageevent-data 204. https://html.spec.whatwg.org/multipage/comms.html#dom-messageevent-origin 205. https://html.spec.whatwg.org/multipage/browsers.html#ascii-serialisation-of-an-origin 206. https://url.spec.whatwg.org/#concept-url-origin 207. https://html.spec.whatwg.org/multipage/comms.html#dom-messageevent-lasteventid 208. https://html.spec.whatwg.org/multipage/server-sent-events.html#concept-event-stream-last-event-id 209. https://dom.spec.whatwg.org/#dom-event-type 210. https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task 211. https://html.spec.whatwg.org/multipage/server-sent-events.html#dom-eventsource-readystate 212. https://html.spec.whatwg.org/multipage/server-sent-events.html#dom-eventsource-closed 213. https://dom.spec.whatwg.org/#concept-event-dispatch 214. https://html.spec.whatwg.org/multipage/server-sent-events.html#eventsource 215. https://html.spec.whatwg.org/multipage/server-sent-events.html#concept-event-stream-last-event-id 216. https://html.spec.whatwg.org/multipage/comms.html#dom-messageevent-lasteventid 217. https://html.spec.whatwg.org/multipage/server-sent-events.html#dispatchMessage 218. https://html.spec.whatwg.org/multipage/indices.html#event-message 219. https://html.spec.whatwg.org/multipage/comms.html#messageevent 220. https://html.spec.whatwg.org/multipage/server-sent-events.html#eventsource 221. https://html.spec.whatwg.org/multipage/comms.html#dom-messageevent-data 222. https://html.spec.whatwg.org/multipage/server-sent-events.html#last-event-id 223. https://html.spec.whatwg.org/multipage/server-sent-events.html#last-event-id 224. https://html.spec.whatwg.org/multipage/server-sent-events.html#eventsource 225. https://html.spec.whatwg.org/multipage/server-sent-events.html#eventsource 226. https://html.spec.whatwg.org/multipage/server-sent-events.html#eventsource 227. https://html.spec.whatwg.org/multipage/workers.html#sharedworkerglobalscope 228. https://html.spec.whatwg.org/multipage/server-sent-events.html#dom-eventsource 229. https://html.spec.whatwg.org/multipage/server-sent-events.html#dom-eventsource 230. https://html.spec.whatwg.org/multipage/server-sent-events.html#last-event-id 231. https://html.spec.whatwg.org/multipage/iana.html#text/event-stream 232. https://html.spec.whatwg.org/multipage/infrastructure.html#other-applicable-specifications 233. https://html.spec.whatwg.org/multipage/server-sent-events.html#eventsource 234. https://html.spec.whatwg.org/multipage/server-sent-events.html#dom-eventsource-readystate 235. https://html.spec.whatwg.org/multipage/server-sent-events.html#dom-eventsource-connecting 236. https://html.spec.whatwg.org/multipage/indices.html#event-open 237. https://html.spec.whatwg.org/multipage/indices.html#event-message 238. https://html.spec.whatwg.org/multipage/indices.html#event-error 239. https://html.spec.whatwg.org/multipage/nav-history-apis.html#window 240. https://html.spec.whatwg.org/multipage/workers.html#workerglobalscope 241. https://html.spec.whatwg.org/multipage/server-sent-events.html#eventsource 242. https://html.spec.whatwg.org/multipage/server-sent-events.html#eventsource 243. https://html.spec.whatwg.org/multipage/server-sent-events.html#eventsource 244. https://html.spec.whatwg.org/multipage/server-sent-events.html#dom-eventsource-readystate 245. https://html.spec.whatwg.org/multipage/server-sent-events.html#dom-eventsource-open 246. https://html.spec.whatwg.org/multipage/indices.html#event-message 247. https://html.spec.whatwg.org/multipage/indices.html#event-error 248. https://html.spec.whatwg.org/multipage/nav-history-apis.html#window 249. https://html.spec.whatwg.org/multipage/workers.html#workerglobalscope 250. https://html.spec.whatwg.org/multipage/server-sent-events.html#eventsource 251. https://html.spec.whatwg.org/multipage/server-sent-events.html#eventsource 252. https://html.spec.whatwg.org/multipage/server-sent-events.html#eventsource 253. https://html.spec.whatwg.org/multipage/server-sent-events.html#remote-event-task-source 254. https://html.spec.whatwg.org/multipage/nav-history-apis.html#window 255. https://html.spec.whatwg.org/multipage/workers.html#workerglobalscope 256. https://html.spec.whatwg.org/multipage/server-sent-events.html#eventsource 257. https://html.spec.whatwg.org/multipage/server-sent-events.html#eventsource 258. https://html.spec.whatwg.org/multipage/server-sent-events.html#eventsource 259. https://html.spec.whatwg.org/multipage/dom.html#document 260. https://fetch.spec.whatwg.org/#concept-fetch 261. https://html.spec.whatwg.org/multipage/server-sent-events.html#eventsource 262. https://html.spec.whatwg.org/multipage/server-sent-events.html#dom-eventsource-readystate 263. https://html.spec.whatwg.org/multipage/server-sent-events.html#dom-eventsource-closed 264. https://html.spec.whatwg.org/multipage/server-sent-events.html#eventsource 265. https://fetch.spec.whatwg.org/#concept-fetch 266. https://html.spec.whatwg.org/multipage/server-sent-events.html#eventsource 267. https://html.spec.whatwg.org/multipage/server-sent-events.html#eventsource 268. https://html.spec.whatwg.org/multipage/server-sent-events.html#eventsource 269. https://html.spec.whatwg.org/multipage/indices.html#event-error 270. https://html.spec.whatwg.org/multipage/comms.html 271. https://html.spec.whatwg.org/multipage/ 272. https://html.spec.whatwg.org/multipage/web-messaging.html
Hidden links: 274. https://html.spec.whatwg.org/multipage/server-sent-events.html#server-sent-events 275. https://html.spec.whatwg.org/multipage/server-sent-events.html#server-sent-events-intro 276. https://html.spec.whatwg.org/multipage/server-sent-events.html#the-eventsource-interface 277. https://html.spec.whatwg.org/multipage/server-sent-events.html#sse-processing-model 278. https://html.spec.whatwg.org/multipage/server-sent-events.html#the-last-event-id-header 279. https://html.spec.whatwg.org/multipage/server-sent-events.html#parsing-an-event-stream 280. https://html.spec.whatwg.org/multipage/server-sent-events.html#event-stream-interpretation 281. https://html.spec.whatwg.org/multipage/server-sent-events.html#authoring-notes 282. https://html.spec.whatwg.org/multipage/server-sent-events.html#eventsource-push 283. https://html.spec.whatwg.org/multipage/server-sent-events.html#garbage-collection 284. https://html.spec.whatwg.org/multipage/server-sent-events.html#implementation-advice