Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

AffData's avatar

Reverb doesn't work after switching from Sail to Herd

No matter what I tried it doesn't work on the frontend with:

WebSocket connection to 'wss://app.test:8080/app/laravel-herd?protocol=7&client=js&version=8.4.0-rc2&flash=false' failed: WebSocket is closed before the connection is established.
REVERB_APP_ID=1001
REVERB_APP_KEY=laravel-herd
REVERB_APP_SECRET=secret
REVERB_HOST="app.test"
REVERB_PORT=8080
REVERB_SCHEME=http

VITE_REVERB_APP_KEY="${REVERB_APP_KEY}"
VITE_REVERB_HOST="${REVERB_HOST}"
VITE_REVERB_PORT="${REVERB_PORT}"
VITE_REVERB_SCHEME="${REVERB_SCHEME}"

If I change the scheme to https it stops working on the backend (events don't dispatch with CURL error). And it doesn't fix the frontend error either.

Everything works well out of the box when I use Docker with Sail. app.test is a placeholder for the .test domain I use on Herd for this project. SSL turned on on the project in Herd.

0 likes
1 reply
markusva's avatar

Went through the same nightmare.

When using https then reverb wants to have a certificate, without it the connection fails.

My reverb.php settings look like this:

'reverb' => [
            'host' => env('REVERB_SERVER_HOST', '0.0.0.0'),
            'port' => env('REVERB_SERVER_PORT', 6001),
            'hostname' => env('REVERB_HOST'),
            'options' => [
                'tls' => [
                    'local_cert' => '/etc/nginx/ssl/fullchain.pem',
                    'local_pk' => '/etc/nginx/ssl/server.key',
                    'verify_peer' => false,
                ],
            ]

Reverb does not provide any information about what is going on, so this command was my biggest friend:

openssl s_client -connect hostname:6001 -showcerts

When I added just my certificate openssl replied that there is a certificate but it is not able to validate it. So I opened the site in browser, exported all three certificates from there, merged them in one file starting from my own certificate, then intermediate and then root certificate, saved it as fullchain and added that as the certificate for reverb.

Then openssl said that everything is ok with certificate.

Then I added this to nginx config in server block:

location /app/ {
            try_files $uri $uri/ /index.php?$query_string;

            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:/ / 127.0.0.1:6001;
        }

Also trying to make the websocket connection with Postman helped a bit.

Please or to participate in this conversation.