Ask A Question


You’re not receiving notifications from this thread.

Actioncable production settings when using heroku + custom domain

Masud Hossain asked in Servers

So I built a website and pushed it to heroku production and bought a domain to reroute to show whatever is on
This all works great, except when it comes to actioncable.

This is my cable.js code:

//= require action_cable
//= require_self
//= require_tree ./channels

(function() {
  this.App || (this.App = {});

  var queryString =;
  var params = {};

  var arr = queryString.split("&");
  for(var key in arr){
    var arr2 = arr[key].split("=");
    params[arr2[0]] = arr2[1];

  App.cable = ActionCable.createConsumer("wss://" + params["token"]);

I've tired changing the wss:// to wss://, but that still doesn't fix the issue. The website is requiring it to be wss:// for some reason.

Any idea how to make this work?


Or do I need to just migrate to Digital ocean in case it's a DNS problem?

I'm doing a CNAME for => for my DNS settings.

Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 77,200+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more.

    © 2023 GoRails, LLC. All rights reserved.