laravel-websockets icon indicating copy to clipboard operation
laravel-websockets copied to clipboard

Error on webSocket connection on console

Open senzlord opened this issue 6 years ago • 3 comments

There are 3 following error :

  1. WebSocket connection to 'wss://127.0.0.1/app/myPushKey?protocol=7&client=js&version=6.0.2&flash=false' failed: Error in connection establishment: net::ERR_CERT_AUTHORITY_INVALID
  2. Access to XMLHttpRequest at 'https://sockjs.pusher.com/pusher/app/myPushKey/405/i071p5ag/xhr_streaming?protocol=7&client=js&version=6.0.2&t=1589180442844&n=1' from origin 'http://127.0.0.1:8000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
  3. Failed to load resource: net::ERR_FAILED

I already follow so many tutorial and following documentation, and still got 3 error of that. Websocket, broadcast is workfine, when i send and event with broadcast websocket still got the data. But in the view not console.log the broadcast i use but that error show up.

I'm Using Laravel 5.8, and composer require pusher/pusher-php-server "~4.0" i'm still on localhost server using xampp with PHP 7.4

senzlord avatar May 11 '20 07:05 senzlord

Hello @senzlord where you able to fix this, having same issues also

henry9162 avatar May 18 '20 22:05 henry9162

try using pusher/pusher-php-server "~3.0"

erlangparasu avatar Aug 01 '20 15:08 erlangparasu

@senzlord Set enabledTransports: ['ws', 'wss'] and forceTLS: false to your Echo configuration.

See https://github.com/beyondcode/laravel-websockets/issues/431

rennokki avatar Aug 13 '20 08:08 rennokki