Faye in Rails as Middleware

472 views
Skip to first unread message

davit

unread,
Apr 20, 2011, 10:43:35 AM4/20/11
to Faye users
How can i use Faye as middleware of my Rails application which works
on apache/mod_passenger?

I try to do someting like that:

# config.ru
require 'faye'
require ::File.expand_path('../config/environment', __FILE__)

use Faye::RackAdapter, :mount => '/faye',
:timeout => 45
run MyApp::Application


But it gives an error on http://localhost:3000/faye

`bad request`

http://localhost:3000/faye.js return true javascript.

Dylan Vassallo

unread,
Apr 24, 2011, 1:34:19 AM4/24/11
to Faye users
I'm curious about this too.

On Apr 20, 7:43 am, davit <mehmetda...@gmail.com> wrote:
> How can i use Faye as middleware of my Rails application which works
> on apache/mod_passenger?
>
> I try to do someting like that:
>
> # config.ru
> require 'faye'
> require ::File.expand_path('../config/environment',  __FILE__)
>
> use Faye::RackAdapter, :mount => '/faye',
>                         :timeout => 45
> run MyApp::Application
>
> But it gives an error onhttp://localhost:3000/faye

James Coglan

unread,
Apr 26, 2011, 6:26:03 AM4/26/11
to Faye users
On Apr 20, 3:43 pm, davit <mehmetda...@gmail.com> wrote:
> How can i use Faye as middleware of my Rails application which works
> on apache/mod_passenger?

Faye can only be run using Thin as the web server, since it needs
Thin's async API to implement concurrent requests and websockets. It
is also a single-process server since it keeps its state in memory, so
it doesn't work under Passenger's process management model. The
upcoming version has a Redis backend that makes the web layer
stateless so this will become less of an issue, but the Thin
requirement is still there.
Reply all
Reply to author
Forward
0 new messages