Server Sent Events PHP Example

Your browser does not support Server Sent Events. Please use Firefox or Google Chrome.

This is simple Server Sent Events (SSE) example that updates stock prices when market moves. Data source is predefined array with prices. These is random delay between 1 and 3 seconds between each event. Feel free to download and study source code.

Tickets

IBM
161.57
AAPL
114.45
GOOG
532.94
MSFT
47.12

Simple Log Console

This is simple log console. It is useful for testing purposes and to understand better how SSE works. Event id and data are logged for each event.

Download source code      Read SSE article
Also you can read next article on the topic Java SSE Chat Example or try Java Servlet Chat Demo.