/Server-Sent-Events-with-Node-JS

Practice of SSE using Node js

Primary LanguageJavaScript

node-http-proxy SSE failure example
=============================


node-http-proxy currently blocks SSE events; this example demonstrates the issue.

Instructions
---------------

  npm install
  npm start

View http://localhost:8000 in chrome or safari. SSE's should periodically stream in.


View http://localhost:9000 in chrome or safari.  This port is node-http-proxy, SSE's will not be received



---------------


Server Sent Events
=============================

Introduction
---------------

Server Sent Events (SSEs) is a form of uni directional communication mechanism where servers
can send data to clients using ordinary HTTP protocols unlike Websockets which are bi-directional and requires specific servers to run.

The examples provided here are implemented using Node JS for the server and plain JS for the HTML file.

The example only works in Chrome and Safari.

More information about SSEs can be found at http://www.html5rocks.com/tutorials/eventsource/basics/

The code in this tutorial are extracted from the demo links at the bottom of the page.