I have been using Sinatra for sometime now and I would like to add some realtime features to my web-app by pushing the data via websockets.
I have successfully used
I stumbled onto this websocket-rack github project which is basically a rackified em-websocket and actually got it to work nicely side-by-side with a Sinatra app. Here's my config.ru:
require 'rubygems'
require 'rack/websocket'
require 'sinatra/base'
class WebSocketApp < Rack::WebSocket::Application
# ...
end
class SinatraApp < Sinatra::Base
# ...
end
map '/ws' do
run WebSocketApp.new
end
map '/' do
run SinatraApp
end
Have fun!
Colin