0

When I run my project, I got an exception error but it does not have a clear message. I only have this kind of the main body error

I can access websocket admin page at http://127.0.0.1:8000/laravel-websockets but when i go http://127.0.0.1:8000/ i got errors below.

The following error was encountered while trying to retrieve the URL: http://127.0.0.1:6001/apps/995591/events?

Connection to 127.0.0.1 failed.

The system returned: (111) Connection refused


The remote host or network may be down. Please try the request again.

Generated Tue, 05 May 2020 17:12:03 GMT by proxyserversetup-s-1vcpu-1gb-sgp1-07 (squid/3.5.27)

I followed every single thing in the docs from this link

Here are some of my config

broadcasting.php

 '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,
                'useTLS' => true,
                'host' => '127.0.0.1',
                'port' => 6001,
                'scheme' => 'http',
                'curl_options' => [
                    CURLOPT_SSL_VERIFYHOST => 0,
                    CURLOPT_SSL_VERIFYPEER => 0,
                ],
            ],
        ],

.env

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=inventory
DB_USERNAME=root
DB_PASSWORD=

BROADCAST_DRIVER=pusher

PUSHER_APP_ID=995591
PUSHER_APP_KEY=644a4ac1988060882370
PUSHER_APP_SECRET=739696537f4fb23b8fcd
PUSHER_APP_CLUSTER=ap1

I am using laravel 6.x and the current version for laravel websockets.

Is it my ISP cause the error?

draw134
  • 1,053
  • 4
  • 35
  • 84
  • Have you also configured the WebSocket app? (to accept those keys) https://docs.beyondco.de/laravel-websockets/1.0/basic-usage/pusher.html#configuring-websocket-apps – Kenny Horna May 05 '20 at 16:37
  • i have that already in my `websockets.php` – draw134 May 05 '20 at 16:43

3 Answers3

8

I had something similar to this happen to me.

If you are using localhost, change

'useTLS' => true,

to false

'useTLS' => false,

It should be in your broadcasting.php file

'connections' => [
    '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'),
            'useTLS' => false,
        ],
    ],
    ....
VnoitKumar
  • 1,350
  • 15
  • 29
1

Making sure you set scheme to https and use 'useTLS' => true then setting up curl_options like below if you set up the paths for SSL certificate & private key.

    'curl_options' => [
        CURLOPT_SSL_VERIFYHOST => 0,
        CURLOPT_SSL_VERIFYPEER => 0,
    ],
Imran
  • 57
  • 2
0

Verify the PUSHER_PORT data in the .env file:

PUSHER_HOST=127.0.0.1
PUSHER_PORT=6379

Verify using CLI in the docroot with artisan command for web socket:

php artisan websockets:serve --port=6379
treckstar
  • 1,956
  • 5
  • 21
  • 26