RTippin / messenger

Laravel messenger. A full messenger suite for your new / existing laravel app! Private and group threads between multiple models, with real-time messaging, reactions, attachments, calling, chat bots, and more!
https://tippindev.com
MIT License
416 stars 84 forks source link

[BUG] WebSocket connection to "wss://127.0.0.1:6001/app/b646bf...........client=js&version=7.6.0&flash=false" failed #69

Closed chegmarco1989 closed 1 year ago

chegmarco1989 commented 1 year ago

Hello.

After installing "pusher/pusher-php-server": "7.0.2", and "beyondcode/laravel-websockets": "^1.14" a, we set our LARAVEL config/broadcasting.php like this:

'pusher' => [
        'driver' => 'pusher',
        'key' => env('PUSHER_APP_KEY', 'app-key'),
        'secret' => env('PUSHER_APP_SECRET', 'app-secret'),
        'app_id' => env('PUSHER_APP_ID', 'app-id'),
        'options' => [
            'host' => env('PUSHER_HOST', '127.0.0.1'),
            'port' => env('PUSHER_PORT', 6001),
            'scheme' => env('PUSHER_SCHEME', 'http'),
            'encrypted' => true,
            'useTLS' => env('PUSHER_SCHEME') === 'https',
        ],
    ],

And LARAVEL .env file like this:

#Pusher/Websockets:

BROADCAST_DRIVER=pusher
PUSHER_APP_ID=1.........77
PUSHER_APP_KEY="b64...............e9f5"
PUSHER_APP_SECRET="81705...........7542"
PUSHER_HOST=127.0.0.1
PUSHER_PORT=6001
MESSENGER_SOCKET_PUSHER=false
MESSENGER_SOCKET_KEY="${PUSHER_APP_KEY}"
MESSENGER_SOCKET_CLUSTER="${PUSHER_APP_CLUSTER}"

We get WebSocket connection to 'wss://127.0.0.1:6001/app/b646bf..........e9f5?protocol=7&client=js&version=7.6.0&flash=false' failed as you can see on the following screenshot here:

WEBSOKET FAILED

PLEASE, Could you help us to fix that error ??? Thanks in advance.

burakertr commented 1 year ago

you dont need PUSHER_HOST declaration in the env file. you need to define followings:

PUSHER_APP_ID=your_pusher_app_id PUSHER_APP_KEY=your_pusher_app_key PUSHER_APP_SECRET=your_pushe_app_secret PUSHER_APP_CLUSTER=your_pusher_cluster MESSENGER_SOCKET_PUSHER=true MESSENGER_SOCKET_KEY="${PUSHER_APP_KEY}" MESSENGER_SOCKET_CLUSTER="${PUSHER_APP_CLUSTER}"