I've been testing with private_pub/faye in development and UAT for a while now, without any issues. When I moved the code to production though I'm getting an error as soon as I go to the page that uses private_pub for a chat interface.
I'm not really sure what is causing the unauthorized access error, this is inside an authenticated part of the site using Devise and CanCan for permission setup.
Has anyone experienced any issues when migrating to production?
Is this likely something I've missed in the setup?
private_pub.yml
development:
server: "http://localhost:9292/faye"
secret_token: "secret"
production:
server: "http://example.com/faye"
secret_token: <secret_token>
signature_expiration: 3600
Startup command:
rackup private_pub.ru -s thin -E production
View code:
<%= subscribe_to "/messages/private/#{@event.id}" %>
When the page loads if I look in the console log on Chrome I get the following error:
GET http://example.com/faye.js 401 (Authorization Required)
In the Rails log I get the following error:
Started GET "/faye.js" for 101.172.127.241 at 2013-04-16 23:00:15 -0400
Processing by ApplicationController#routing_error as JS
Parameters: {"path"=>"faye"}
Completed 401 Unauthorized in 1ms