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

danimohamadnejad's avatar

Laravel reverb Pusher error: cURL error 7: Failed to connect to 0.0.0.0 port 443: Connection refused

Hi I am using laravel reverb to broadcast an event but I get following error: after event is dispatched: Pusher error: cURL error 7: Failed to connect to 0.0.0.0 port 443: Connection refused following is my code:


BROADCAST_CONNECTION=reverb
REVERB_APP_ID=111
REVERB_APP_KEY=222
REVERB_APP_SECRET=333
REVERB_HOST=0.0.0.0
REVERB_SCHEME=http


<?php

namespace App\Livewire;

use Livewire\Component;
use App\Events\MsgSubmissionEvent;
use Livewire\Attributes\On;

class Home extends Component
{
    public $name;
    public function send(){
     event(new MsgSubmissionEvent);
    }
    #[On('echo:channel-name,MsgSubmissionEvent')]
    public function handle1() : void{
    }
    public function render()
    {
        return view('livewire.home');
    }
}


<?php

namespace App\Events;

use Illuminate\Broadcasting\Channel;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Broadcasting\PresenceChannel;
use Illuminate\Broadcasting\PrivateChannel;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;

class MsgSubmissionEvent implements ShouldBroadcast
{
    use Dispatchable, InteractsWithSockets, SerializesModels;
    public function broadcastOn(): array
    {
        return [
            new PrivateChannel('channel-name'),
        ];
    }
}




I click a button and send method in Home livewire class is called then event is fired and must be handled by handle1 method but I get error. I have already started reverb. I stopped reverb but sill the same error.

0 likes
2 replies
tobz.nz's avatar

@danimohamadnejad did you sort this out? I'm having a similar issue.

I'm using Laravel Sail & trying to get Reverb working. Client-side works fine - connects, authorises & receives pings every minute. But when I try to dispatch an event I get a similar error to you, except using the domain the site is running on(e.g. myapp.localhost).

tobz.nz's avatar

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'],
});

Please or to participate in this conversation.