I have a problem with my socket settings and it seems everything is ok but I got this error:
pusher.min.js:8 WebSocket connection to 'wss://www.example.com:8443/app/ABCDEFG?protocol=7&client=js&version=4.3.1&flash=false' failed: Error during WebSocket handshake: Unexpected response code: 426
I've checked all questions and answers with this topic but no results!
Could you help me, please...
Versions of packages I've used:
- "pusher-js": "^7.0.0",
- "laravel-echo": "^1.9.0",
- "pusher/pusher-php-server": "~4.1",
- "beyondcode/laravel-websockets": "^1.9.0"
These are my bootstrap.js codes:
window.Echo = new Echo({
broadcaster: 'pusher',
key: process.env.MIX_PUSHER_APP_KEY,
cluster: process.env.MIX_PUSHER_APP_CLUSTER,
wsHost: window.location.hostname,
wsPort: 8443,
disableStats: true,
enabledTransports: ['ws', 'wss'],
forceTLS: true,
encrypted: true,
wssPort: 8443,
});
This is also my broadcasting.php:
'connections' => [
'pusher' => [
'driver' => 'pusher',
'key' => env('PUSHER_APP_KEY'),
'secret' => env('PUSHER_APP_SECRET'),
'app_id' => env('PUSHER_APP_ID'),
'log' => true,
'options' => [
'cluster' => env('PUSHER_APP_CLUSTER'),
'host' => 'example.com',
'port' => 8443,
'scheme' => 'https',
//'useTLS' => true,
'encrypted' => true,
'curl_options' => [
CURLOPT_SSL_VERIFYHOST => 0,
CURLOPT_SSL_VERIFYPEER => 0,
]
]
],
'redis' => [
'driver' => 'redis',
'connection' => 'default',
],
'log' => [
'driver' => 'log',
],
'null' => [
'driver' => 'null',
],
],
Here is picture of same error in firefox
I see I should provide an upgrade header, but I don't know how!
question from:
https://stackoverflow.com/questions/65915080/error-during-websocket-handshake-when-using-laravel-websockets