Figured it out - leaving the fix here for others/myself.
I forgot to mention I've got nginx setup i my dockerfile on top of the defailt Sail Setup.
First step is to add a block to your server definition:
server {
...
location /app {
proxy_http_version 1.1;
proxy_set_header Host $http_host;
proxy_set_header Scheme $scheme;
proxy_set_header SERVER_PORT $server_port;
proxy_set_header REMOTE_ADDR $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_pass http://${APP_SERVICE}:8080;
}
}
and forward the port in the docker-compose
services:
laravel.test:
...
ports:
...
- '${REVERB_PORT:-8080}:8080'
set the .env variables
// .env
REVERB_HOST=localhost
REVERB_SCHEME=http
REVERB_PORT=8080
REVERB_VERIFY_SSL=false
and fianlly setting up echo. note the host is NOT taken from the .env
new Echo({
broadcaster: 'reverb',
csrfToken: csrfToken,
key: key,
wsHost: window.location.host,
wsPort: 80,
wssPort: 443,
cluster: 'mt1',
forceTLS: false,
disableStats: true,
enabledTransports: ['ws', 'wss'],
});