0

I am using laravel websocket in my laravel project. In broadcasting.php, there is pusher configuration like this below:

'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'
            ],
        ],

My question is what will be the value of host here when on live server ? My domain is https://test.something.domain.

Also can I keep the port number 6001 on live server as in local ?

quad que
  • 31
  • 6

1 Answers1

0

based on documentation about broadcasting pusher we just need

PUSHER_APP_ID=your-pusher-app-id
PUSHER_APP_KEY=your-pusher-key
PUSHER_APP_SECRET=your-pusher-secret
PUSHER_APP_CLUSTER=mt1

host and port it's doesn't matter if you don't add to the pusher options broadcasting.php because pusher has publish they own way on their server. but if you have own websocket you must add host and port because websocket need this.

  • I am using laravel websockets package with pusher credentials (api key, app id, secret etc). I mean I am using pusher credentials but actually not pusher. Instead of pusher I am using laravel websocket package which uses pusher credentials. Do I need host in this case ? – quad que Apr 26 '23 at 06:43
  • it's doesn't matter if you don't add host for this case. So you don't need host – Yoga Meleniawan P Apr 26 '23 at 06:46
  • i mean you don't need to change the host. based on this documentation [link](https://beyondco.de/docs/laravel-websockets/basic-usage/pusher) the default host value is 127.0.0.1 so you don't need to change this value – Yoga Meleniawan P Apr 26 '23 at 06:53
  • When trying from live server getting an error like "Pusher error: cURL error 7: Failed to connect to 127.0.0.1 port 6001" but works in local – quad que Apr 26 '23 at 06:55
  • 2
    have you start websocket server? you can use supervisor to running websocket server in production server – Yoga Meleniawan P Apr 26 '23 at 07:05
  • No I haven't start. That might be the issue. I am checking – quad que Apr 26 '23 at 07:08
  • Can you tell me how to use supervisor with laravel or provide any documentation ? I am using hostinger. – quad que Apr 26 '23 at 07:12
  • you can see this documentation about [supervisor](https://beyondco.de/docs/laravel-websockets/basic-usage/starting). i don't have experience with hostinger. but you need to know about your hosting. it is shared hosting/vps/something else? because if you're using shared hosting you need to contact Hostinger to provide supervisor on your hosting. – Yoga Meleniawan P Apr 26 '23 at 07:29