server-sent-events
Server-Sent-Events library for crystal.
Now supports only client.
Installation
- Add the dependency to your
shard.yml
:
dependencies:
sse:
github: y2k2mt/sse.cr
version: 0.3.0
- Run
shards install
Usage
sse = HTTP::ServerSentEvents::EventSource.new("http://app/ssedemo")
sse.on_message do |message|
# Recieving messages from server
p message.data
end
sse.run
How to test
# Running node sse server
npm install
npm start &
# Run specs
crystal spec
Contributing
- Fork it (https://github.com/y2k2mt/sse.cr/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
Contributors
- y2k2mt - creator and maintainer