Registry / web-framework / sinatra-websocket

sinatra-websocket

JSON →
library0.3.1rbrubygemsunverified

Upgrades any Sinatra request to a WebSocket connection.

gem install sinatra-websocket
INSTALL
IMPORT
SIG · SINATRA-WEBSOCKET
S
sinatra-websocket
web-frameworkrubyv0.3.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Sinatra::WebSocket
require 'sinatra/websocket'

Handle WebSocket connections in Sinatra.

require 'sinatra/websocket' get '/chat' do if request.websocket? request.websocket do |ws| ws.on_message do |msg| ws.send "Echo: #{msg}" end end end end
Debug
Known issues
gotchaRequires a WebSocket-capable server (e.g., Thin or Puma with support).
fix
Use a server like Thin: `gem install thin` and run with `thin start`.
affects: >= 0
Upgrade
Version history
0.3.1latest on RubyGems
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
sinatra-websocket — gem install sinatra-websocket · libregistry