https://github.com/makevoid/sinatra_sse_example
Sinatra example using EventSource (Server Sent Events)
https://github.com/makevoid/sinatra_sse_example
Last synced: 9 months ago
JSON representation
Sinatra example using EventSource (Server Sent Events)
- Host: GitHub
- URL: https://github.com/makevoid/sinatra_sse_example
- Owner: makevoid
- Created: 2016-06-15T10:36:38.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2022-05-27T17:41:25.000Z (over 3 years ago)
- Last Synced: 2025-03-25T06:02:47.829Z (10 months ago)
- Language: Ruby
- Homepage:
- Size: 4.88 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
## Sinatra-stream Example
Sinatra example using EventSource (Server Sent Events)
Original code from:
Server Sent Events are an awesome api that lets you push data asynchronously directly to your clients.
A polyfill for EventSource is available (thanks IE), please check:
### Setup:
gem i bundler
bundle
(you need to have Redis installed)
On ubuntu you can install redis by:
apt-get install redis-server
# Run:
bundle exec rackup
# Usage:
Open
Then from your console:
redis-cli publish message hello
Voila', you shoul see your message in every browser window you have open.