Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

9. Hacking HTML5 Connectivity > Hack 74. Push Notifications to the Browser with...

Hack 74. Push Notifications to the Browser with Server-Sent Events

Created by Opera, Server-Sent Events standardizes Comet technologies. The standard intends to provide you with native, real-time updates through a simple JavaScript API called EventSource, which connects to servers that asynchronously push data updates to clients via HTTP streaming. Server-Sent Events uses a single, unidirectional, persistent connection between the browser and the server.

Unlike the WebSocket API, Server-Sent Events and the EventSource object use HTTP to enable real-time server push capabilities within your application. HTTP streaming predates the WebSocket API, and it is often referred to as Comet or server push. The exciting part here is that the Server-Sent Events API intends to standardize the Comet technique, making it trivial to implement in the browser.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint