A small Server Sent Events demo for San Diego JS Meetup using Node, HTML, JavaScript, CSS. I also wrote a post on Medium about this topic.
Slides can be found here.
The following instructions assume Mac OS / Linux system with Python installed (to provide a simple web server).
git clone https://github.com/simonprickett/server-sent-events-demo.git
cd server-sent-events-demo
cd src/server
npm install
npm start
cd src/client
python -m SimpleHTTPServer
Then point a browser at http://localhost:8000/
.
- MDN Server Sent Events Guide
- HTML 5 Rocks Tutorial
- O'Reilly High Performance Browser Networking SSE page
- Data source for cat facts
- Server Sent Events aren't implemented in MS Edge and are currently "under consideration"... read more and vote here