Thanks to visit codestin.com
Credit goes to github.com

Skip to content

JimtotheB/Easy_SSE

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Server Sent events with Express

One way event streams made easy.

How can I test this out?

 $ git clone https://github.com/PaperElectron/Easy_SSE.git
 $ npm install
 $ npm start

Open localhost:8080/ in a few browser windows and start clicking some buttons. The code comments and documentation load with the demo server.

Why not just use Socket.io?

Socket.io is complex, has pretty tough proxy requirements, and is pretty hard to add to an application.

In need of a solid, low overhead, low disruption-to-codebase technology to push realtime data to browsers. Obviously Socket.io right...? Well, that is pretty hard to stomach when you have a large, complex existing API that already does everything you need.

In a soft realtime situation, the better option may just be SSE, which is a fairly well supported HTML5 API (IE available with a polyfill).

  • Endless data streams and updates from the server in real time.

  • Easily bind multiple server side data streams from one endpoint.

  • Demo uses event emitter, send events from anywhere inside your app.

  • Vastly simpler than websockets/socket.io if realtime two way streams aren't needed.

  • Arguably simpler than socket.io even for two way streams. Just send data back to your existing API endpoints and emit events.

More info?

Can I use that?

But there is a polyfill for IE right?

Where can I learn more about this?

Some helpful libraries.

iOS/mac

Android

About

Easy Server Sent Events demo.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published