WebSocket is closed before the connection is established

I have been using great package by Beyondcode laravel-websockets. Recently I tried to connect to the websocket server in a new application and got the following error “failed: WebSocket is closed before the connection is established”. Strangely enough this error was manifested in Chrome and not in Firefox. After digging a little bit I found that the error can be fixed by adding a line to Laravel Echo configuration: enabledTransports: [‘ws’, ‘wss’] as suggested here https://github.com/beyondcode/laravel-websockets/issues/83

Share this article

Posted

in

by

Tags: