I'm using Private_Pub gem which is built on Faye, and I'm using a another app for the Faye which is provided by this blog the project that I found. to get Faye running on an app and my actual site on another app.
The error in FireFox console:
The connection to ws://xxxxxxxxxxx.herokuapp.com/faye was interrupted while the page was loading. Faye.js
and in Chrome:
WebSocket connection to 'ws://xxxxxxxxxxx.herokuapp.com/faye' failed: One or more reserved bits are on: reserved1 = 1, reserved2 = 0, reserved3 = 0
on the Chat (Faye) app log I get this in the log :
at=error code=H12 desc="Request timeout" method=GET path=/faye host=xxxxxxxxxxx.herokuapp.com request_id=xxxxxxxxxxx fwd="xxxxxxxxxxx" dyno=web.1 connect=31ms service=30112ms status=503 bytes=0
any suggestions: ?
I have added an after_filter
in the application_controller
as well to allow the domain request
To solve this problem, the
Rails Apps
need to let each other access or let's say ping each other. In order to do that, we have to use something like CORS, to allow AJAX Request from Other Domain. Here is a simpler way that I used to go allow method accesses article, it might sound confusing at first.To do perform this on both sides, you need to create an actual complete app for the
Faye
as well, unlike what is given on the Faye chat server Repo I've attached in my question.In the Actual/Main App include this in your
application_controller.rb
Step 2:
on the Faye app side include the same thing in the
application_controller.rb
, but change the domain name to the Original/Actual/Main Rails app.In that way, both can send and receive requests. Don't put
*
instead of the requestparameter
, it's a security issue. You can cut down themethods
to onlyGet
andPost
.