This is a demo showing how to configure faye to run in your rails app as middlware.
You can see a live demo of this repo on heroku at faye-rails-example.herokuapp.com
-
Add faye and thin to the
Gemfile
gem 'faye' gem 'thin'
-
Add a line to
config/application.rb
to use faye middleware (also add to config.ru, heroku may look there)config.middleware.use Faye::RackAdapter, :mount => '/faye', :timeout => 25
-
Put any middleware extensions you'd like into the
app/middleware
folder -
Run the server in production with
rails s -e production
(you can't use faye in development because some development middleware breaks faye)
Note: To allow the rails app to server static assets in production without the need for a proxy, config/environments/production.rb was tweaked.