Skip to content
A crystal shard for server-sent-events
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
spec Overhaul Jun 12, 2019
src Fix Jun 12, 2019
.ameba.yml ameba.yml Jun 12, 2019
.gitignore An ameba inspection Nov 12, 2018
.travis.yml Update travis.yml Nov 12, 2018
LICENSE Licensing Nov 12, 2018
README.md Update README.md Jun 12, 2019
package-lock.json Initial commit Nov 2, 2018
package.json Initial commit Nov 2, 2018
shard.lock Compatible with crystal 0.29 Jun 11, 2019
shard.yml Compatible with crystal 0.29 Jun 11, 2019
stub-server.js Compatible with crystal 0.29 Jun 11, 2019

README.md

server-sent-events

Build Status Releases

Server-Sent-Events library for crystal.

Now supports only client.

Installation

  1. Add the dependency to your shard.yml:
dependencies:
  sse:
    github: y2k2mt/sse.cr
    version: 0.3.0
  1. 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

  1. Fork it (https://github.com/y2k2mt/sse.cr/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

  • y2k2mt - creator and maintainer
You can’t perform that action at this time.