EventSource interface is web content's interface to server-sent events. An
EventSource instance opens a persistent connection to an HTTP server, which sends events in
Documentation EventSource by Mozilla Contributors, licensed under CC-BY-SA 2.5.
EventHandler called when a
message event is received, that is when a message is coming from the source.
EventHandler called when an
open event is received, that is when the connection was just opened.
A number representing the state of the connection. Possible values are
DOMString representing the URL of the source.
Boolean indicating whether the
EventSource object was instantiated with cross-origin (CORS) credentials set (
true), or not (
false, the default).
Closes the connection, if any, and sets the
readyState attribute to
CLOSED. If the connection is already closed, the method does nothing.