The HTML Server Sent Events allow a web page to receive automatic updates from a server via HTTP connection.
The Server-Sent Events EventSource API is standardized as part of HTML5 by the W3C.
Note: We provided PHP and Node.js server-side code to demonstrate the Server Sent Events. Please choose any one of your favorites.
The following is the PHP server-side code used for the below examples.
The following is the Node.js server-side code used for the below examples.
The following is your client-side code.