Skip to content
This repository has been archived by the owner on Apr 27, 2021. It is now read-only.
/ rack-sse Public archive

A demo of using rack-async to power HTML5 Server Sent Events

Notifications You must be signed in to change notification settings

magnetised/rack-sse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Really simple server that generates events as per the HTML5 Server-Sent Events spec.

http://dev.w3.org/html5/eventsource/

To try it out:

$ git clone git://github.com/magnetised/rack-sse.git
$ cd rack-sse
$ bundle install
$ bundle exec thin start

Then goto http://localhost:3000 in your browser or view the message stream directly using curl:

curl -v http://localhost:3000/messages

To send a message you have to send a POST to /messages. Using curl:

curl -X POST -d "message=hello99s" http://localhost:3000/messages

This uses the new stream method in Sinatra 1.3 (and the evented connections provided by Thin) to keep multiple connections open without stressing the server.

About

A demo of using rack-async to power HTML5 Server Sent Events

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages