Closed thecyrilcril closed 2 months ago
From what I’m seeing it’s not look like a Laravel issue. Just an attempt to POST data directly from your front-end app to sockjs.pusher.com
(which don’t seem to add the correct Access-Control-Allow-Origin
header).
I found this link talking about it (not directly about web-socket).
But I think for the current situation, you’ll cannot do nothing else than just consume the service from your client-side, see details : https://laravel.com/docs/11.x/broadcasting#client-pusher-channels so by reaching your own back-end server.
From what I’m seeing it’s not look like a Laravel issue. Just an attempt to POST data directly from your front-end app to
sockjs.pusher.com
(which don’t seem to add the correctAccess-Control-Allow-Origin
header). I found this link talking about it (not directly about web-socket). But I think for the current situation, you’ll cannot do nothing else than just consume the service from your client-side, see details : https://laravel.com/docs/11.x/broadcasting#client-pusher-channels so by reaching your own back-end server.
@noefleury I have updated the issue, I ommited the listening on the frontend but it was there all along, I also add the following line enabledTransports: ['ws', 'wss']
and my cors error seems to go away but I still have this error:
app-X48mdDuV.js:13 WebSocket connection to 'wss://ws-.pusher.com/app/?protocol=7&client=js&version=8.4.0-rc2&flash=false' failed:
I guess its similar to these issues https://github.com/laravel/reverb/issues/153 and https://github.com/laravel/reverb/issues/78
Laravel Version
11.21.0
PHP Version
8.3.0
Database Driver & Version
10.6.18-MariaDB-cll-lve - MariaDB Server
Description
Broadcastng works in development on Windows machine but fails in production with the following errors in the console
Here is what my setup looks like
.env
echo.js
bootstrap/app.php
app.blade.php (within a alpine component)
Steps To Reproduce
Not sure it applies, but my settings are in the description