Skip to content
This repository was archived by the owner on Apr 27, 2021. It is now read-only.
magnetisedPublic archive

About

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

Resources

Stars

5 stars

Watchers

1 watching

Forks

Latest commit

 

History

11 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

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

5 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages