mhadaniya's avatar

How to use PUSHER with docker

Hi,

I'm trying to use broadcast events within an already running solution. It is using docker-compose with 3 services: app, nginx, postgres.

I'm trying to use broadcast using Pusher. I did the config in .env, changed the event to implements ShouldBroadcast. Using log as the broadcast driver, it is working... but when I changed to pusher, it is not working... it gives me the follwing error:

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

I realized it has something to do with the field host in config/broadcasting.php. But still dunno what I'm missing.

'pusher' => [
            'driver' => 'pusher',
            'key' => env('PUSHER_APP_KEY'),
            'secret' => env('PUSHER_APP_SECRET'),
            'app_id' => env('PUSHER_APP_ID'),
            'options' => [
                'cluster' => env('PUSHER_APP_CLUSTER'),
                'encrypted' => false,
                'host' => '127.0.0.1',
                'port' => 6001,
                'scheme' => 'http'
            ],
        ],

Anyone can give me some directions or hints on what to look for?

0 likes
5 replies
mhadaniya's avatar

@Sinnbeck Thank you!

I'm using the pusher service.

I haven't changed the broadcast.php, it was like that when I got the project... but I removed all the fields and let the same fields as you shared... and it worked! Thanks!!!

Sinnbeck's avatar

@mhadaniya sounds like someone might have tested out a local server like laravel websockets

Please or to participate in this conversation.