Faye on apache

203 views
Skip to first unread message

radhames brito

unread,
Mar 5, 2012, 9:45:49 PM3/5/12
to Faye users
Hello, i recently had to move my app to a new server and now im having
problems setting apache to proxypass to thin, i have this

ProxyPass /bayeux http://localhost:9292
ProxyPassReverse /bayeux http://localhost:9292

But i keep getting



NetworkError: 400 Bad Request - http://172.16.85.2/bayeux/faye"
Firefox can't establish a connection to the server at ws://172.16.85.2/bayeux/faye.

on the console when i access the production server but i added the
incoming and outgoing methods from the site and i can see
communication passing, yet i cant see the data i want coming in.

Im i doing something wrong?

faye (0.6.7)

James Coglan

unread,
Mar 6, 2012, 4:20:36 AM3/6/12
to faye-...@googlegroups.com
On 6 March 2012 02:45, radhames brito <rbr...@gmail.com> wrote:
NetworkError: 400 Bad Request - http://172.16.85.2/bayeux/faye"
Firefox can't establish a connection to the server at ws://172.16.85.2/bayeux/faye.

on the console when i access the production server but i added the
incoming and outgoing methods from the site and i can see
communication passing, yet i cant see the data i want coming in.

Im i doing something wrong?

That's just Firefox trying to open a WebSocket to Apache and failing, because Apache doesn't support WebSockets. Faye should fall back to another transport and keep sending messages -- is your application not working because of this? 

radhames brito

unread,
Mar 6, 2012, 7:07:40 AM3/6/12
to Faye users

> That's just Firefox trying to open a WebSocket to Apache and failing,
> because Apache doesn't support WebSockets. Faye should fall back to another
> transport and keep sending messages -- is your application not working
> because of this?

Thanks for the reply, i also see this in chrome

POST http://172.16.85.2/bayeux/faye
Faye.Transport.XHR.Faye.extend.Faye.Class.requestfaye.js:1
(anonymous function)

I dont see any of this in development and everything was, fine before
changing servers
Do you see anything wrong in my proxy setup ?

I will test the communication later today to see if im still able to
publish.


here a bit more of my config


faye.ru

faye_server = Faye::RackAdapter.new(:mount => '/faye', :timeout => 25)
faye_server.add_extension(ServerAuth.new)
run faye_server

start task for capistrano

namespace :faye do
desc "Stop the thin server"
task :stop, :roles => :app do
run "thin -d stop -p 9292 -R #{deploy_to}/current/faye.ru -e
production"
end

desc "Start the thin server"
task :start, :roles => :app do
run "thin -d start -p 9292 -R #{deploy_to}/current/faye.ru -e
production"
end

desc "Restart the thin server"
task :restart, :roles => :app do
run "thin -d restart -p 9292 -R #{deploy_to}/current/faye.ru -e
production"
end
end

js script for subscribing

var faye = new Faye.Client('http://<%=FAYE_SERVER%>/faye');
faye.addExtension(Logger);
var subscription= faye.subscribe



Here the logger does work.


James Coglan

unread,
Mar 6, 2012, 7:13:43 AM3/6/12
to faye-...@googlegroups.com
On 6 March 2012 12:07, radhames brito <rbr...@gmail.com> wrote:
 Do you see anything wrong in my proxy setup ?

I'm not an expect on Apache but I would recommend not using it with Faye -- it doesn't support several things Faye needs. You're better of exposing the Faye server directly to the Internet, or possible putting HAProxy in front of it. 

radhames brito

unread,
Mar 7, 2012, 11:53:17 AM3/7/12
to Faye users

> I'm not an expect on Apache but I would recommend not using it with Faye --
> it doesn't support several things Faye needs. You're better of exposing the
> Faye server directly to the Internet, or possible putting HAProxy in front
> of it.

Is ok, apart from the warning there doesn't seems to be any other
issue, apache is working find.
Reply all
Reply to author
Forward
0 new messages