So I'm building an app where a dev requirement is to develop locally on SSL/TSL self-signed certificates. I do this by adding an entry for a fake domain, like abc.localhost , to my /etc/hosts file
Using
rails 7.0.6 react_on_rails ~> 13.4 shakapacker ~> 7.0
I have a special setup which boots my Rails server telling Puma to listen for SSL connections using the self-signed certificate.
using this Procfile.dev:
# Procfile for development using HMR
# You can run these commands in separate shells
rails: bin/rails s -b 'ssl://0.0.0.0:3000?key=config/ssl/abc.localhost.key&cert=config/ssl/abc.localhost.crt'
wp-client: bin/shakapacker-dev-server
wp-server: SERVER_BUNDLE_ONLY=yes bin/shakapacker --watch
Take note that this setup also has these lines in development.rb
config.force_ssl = true
config.hosts << "abc.localhost"
config.action_cable.url = "wss://abc.localhost/cable"
config.action_cable.allowed_request_origins = [ "*" ]
WHen I go to https://abc.localhost:3000, the Shakapacker hello world comes up fine:
but in the console I am getting WebSocketClient.js:13 WebSocket connection to 'wss://localhost:3035/ws' failed:
I believe this is caused by the react-refresh-webpack-plugin, specifically, it looks like this plugin is looking for the websocket at localhost:3035 when it should be looking for it at abc.localhost:3035
can I fix the react-refresh-webpack-plugin (shakapacker/react_on_rails) setup to either respect the config.action_cable.url setting or set it explicitly to my non-standard domain?
Example app can be found here:

