Rails4: Private Pub over HTTPS on Heroku

94 views Asked by At

I'm doing an app which uses private pub gem to work, and its run ok on localhost, but not when I deploy it to heroku. I think that problem which is HTTPS protocol on Heroku. I'm already tried almost everything to do it run on Heroku, but I did not find a solution yet. Someone already make the private pub run over HTTPS before?

The cert is trusted by browser. I'm testing on Opera and Chrome. If I change to http on heroku, the file faye.js is blocked and do not loaded. When I run the thin server on heroku I get the error: "Sure you're not looking for /faye ?", And when I do not load the thin server by procfile I get a js error on browser when the chat is loaded: application-2563428….js:19064 GET myapp.herokuapp.com/faye.js

my setup is:

private_pub.yml (/config)

development:
  server: "http://localhost:9292/faye"
  secret_token: "secret"
test:
  server: "http://localhost:9292/faye"
  secret_token: "secret"
production:
  server: "https://my.app.com/faye"
  secret_token: "c2c373dd2d7b8d080311d4d32f9710a7c01ee627c30a75ec1143559b74a82c75"
  signature_expiration: 86400 # one day

private_pub.ru (/)

require "bundler/setup"
require "yaml"
require "faye"
require "private_pub"

Faye::WebSocket.load_adapter('thin')

PrivatePub.load_config(File.expand_path("../config/private_pub.yml", __FILE__), ENV["RAILS_ENV"] || "production")
run PrivatePub.faye_app

I'm already tried this and this without success. My tutorial reference is this.

A guy was success at here, but I still have not figured out how.

Thanks!

0

There are 0 answers