socket_io
Version, currently master branch1 version
- master branchlatestOct 17, 2016
github.com/forsaken1/socket-io.cr
Small analog socket.io
6 stars
0 dependents
License: MIT
Installation
# Add this to your shard.yml
dependencies:
socket_io:
github: forsaken1/socket-io.cr
branch: mastermaster is a branch, not a release, so this tracks it rather than pinning a version.
Then run:
shards installshard.yml
- Crystal
- no constraint declared
- License
- MIT
- Author
- Krylov Alexey
Dependencies
This version declares no dependencies.
README
SocketIO
Small analog socket.io
Installation
Add this to your application's shard.yml:
dependencies:
socket_io:
github: forsaken1/socket-io.cr
Usage
With Kemal:
require "kemal"
require "socket_io"
socket_io = SocketIO::Base.new
handler = socket_io.on_connection do |session| # session : SocketIO::WebSocket
session.on("client_event") do |message|
puts message
session.emit("some_event", { message: "Hello!" })
end
end
socket_io.emit :tick, { array: [1, 2, 3, 4], hash: { field: "Field" } } # send to all client
Kemal.config.add_handler handler
Kemal.run
On client
Use JS analog SocketIO.js
Contributing
- Fork it ( https://github.com/forsaken1/socket-io.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
- forsaken1 Krylov Alexey - creator, maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This branch
- Branch
master- Seen
- Oct 17, 2016
- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/forsaken1/socket-io.cr
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 12, 2026
- Synced
- Aug 12, 2026
- Versions
- 1