Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Server-sent events

From Wikipedia, the free encyclopedia
Server push technology

Server-Sent Events (SSE) is aserver 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 ofHTML Living Standard[1] by theWHATWG. Themedia type for SSE istext/event-stream.

All modern browsers support server-sent events:Firefox 6+,Google Chrome 6+,Opera 11.5+,Safari 5+,Microsoft Edge 79+.[2]Since SSE does not use either persistent connections norchunked transfer encoding, HTTP/1.1 is not a technical requirement.

History

[edit]

The SSE mechanism was first specified byIan Hickson as part of the "WHATWG Web Applications 1.0" proposal starting in 2004.[3] In September 2006, theOpera web browser implemented the experimental technology in a feature called "Server-Sent Events".[4][5]

Example

[edit]
varsource=newEventSource('updates.cgi');source.onmessage=function(event){alert(event.data);};

See also

[edit]

References

[edit]
  1. ^"HTML Living Standard: 9.2 Server-sent events".WHATWG. 31 March 2022.
  2. ^When can I use... Server-sent DOM events
  3. ^Hickson, Ian, ed. (1 January 2006)."Server-sent DOM events". Web Applications 1.0.WHATWG. Retrieved2024-05-09.
  4. ^Bersvendsen, Arve (1 September 2006)."Event Streaming to Web Browsers".dev.opera.com. Archived fromthe original on 2014-07-04.
  5. ^Stream Updates with Server-Sent Events, Eric Bidelman, HTML5Rocks website.

External links

[edit]
Protocols
Server APIs
Apache modules
Topics
Browser APIs
Web APIs
WHATWG
W3C
Khronos
Others
Topics
Related topics
Stub icon

This Internet-related article is astub. You can help Wikipedia byexpanding it.

Retrieved from "https://en.wikipedia.org/w/index.php?title=Server-sent_events&oldid=1313230683"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2025 Movatter.jp