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

shadkamel's avatar

Laravel Broadcasting

hello, i have problem with laravel broadcasting while using pusher, when i excute an event the page will show an error that can't connect to pusher, here is the error:

Pusher error: cURL error 7: Failed to connect to 127.0.0.1 port 443: Connection refused (see https://curl.haxx.se/libcurl/c/libcurl-errors.html)

i just implemented all documentation but it doesn't worked.

0 likes
7 replies
vincent15000's avatar

Can you give more information about the pusher server you are using ?

Have you installed something locally or do you use the online pusher API ?

What is your configuration code for pusher ?

shadkamel's avatar

@vincent15000 sure, i am using pusher api but my project is local,

// .env
PUSHER_APP_ID=1581903
PUSHER_APP_KEY=ea505472b0d5e09b330b
PUSHER_APP_SECRET=1dedb1cf5cebadb3f749
PUSHER_APP_CLUSTER=mt1
PUSHER_HOST="http://127.0.0.1"
PUSHER_PORT=443
PUSHER_SCHEME=https
// broadcasting.php
'pusher' => [
            'driver' => 'pusher',
            'key' => env('PUSHER_APP_KEY'),
            'secret' => env('PUSHER_APP_SECRET'),
            'app_id' => env('PUSHER_APP_ID'),
            'options' => [
                'host' => env('PUSHER_HOST', 'api-'.env('PUSHER_APP_CLUSTER', 'mt1').'.pusher.com') ?: 'api-'.env('PUSHER_APP_CLUSTER', 'mt1').'.pusher.com',
                'port' => env('PUSHER_PORT', 443),
                'scheme' => env('PUSHER_SCHEME', 'https'),
                'encrypted' => false,
                'cluster' => 'mt1',
                'useTLS' => false
            ],
            'client_options' => [
                // Guzzle client options: https://docs.guzzlephp.org/en/stable/request-options.html
                CURLOPT_SSL_VERIFYHOST => 0,
                CURLOPT_SSL_VERIFYPEER => 0,
            ],
        ],
1 like
vincent15000's avatar

Even if your project is local, the pusher host is where the pusher server is.

This won't work.

PUSHER_HOST="http://127.0.0.1"

You need to configure pusher with the pusher server address.

vincent15000's avatar
Level 63

@shadkamel Here is an example of a pusher configuration I have used in a project.

PUSHER_APP_ID=your_pusher_app_id
PUSHER_APP_KEY=your_pusher_app_key
PUSHER_APP_SECRET=your_pusher_app_secret
PUSHER_HOST=
PUSHER_PORT=443
PUSHER_SCHEME=https
PUSHER_APP_CLUSTER=eu

You also need to specify the app cluster which can be different according to the geographic location of the server.

Then you have the broadcasting configuration.

'pusher' => [
   'driver' => 'pusher',
   'key' => env('PUSHER_APP_KEY'),
   'secret' => env('PUSHER_APP_SECRET'),
   'app_id' => env('PUSHER_APP_ID'),
   'options' => [
       'cluster' => 'eu',
       'useTLS' => true
   ],
   'client_options' => [
   ],

If you are using the pusher API, you have no pusher host to define.

Have you correctly defined the events and the listeners ?

1 like

Please or to participate in this conversation.