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

WebSocket is closed before the connection is established.

Open playbert opened this issue 6 years ago • 8 comments

Error generated in the local server xampp, the terminal received in real time the websocket chat: server but on the web the console in the browser generated the warning

app.js:38876 WebSocket connection to 'wss://127.0.0.1:6001/app/websocketkey?protocol=7&client=js&version=4.3.1&flash=false' failed: WebSocket is closed before the connection is established.

The received messages are not updated automatically in the browser.

playbert avatar Mar 26 '19 23:03 playbert

Having the same issues

aeegvk avatar Jul 01 '19 09:07 aeegvk

Yup. Getting this too.

Did either of you work out the issue?

jonnywilliamson avatar Aug 25 '19 15:08 jonnywilliamson

Same Issue here. I have to refresh the page to fetch new entries. Looks like an issue with Pusher connection.

PrasadChinwal avatar Feb 24 '20 17:02 PrasadChinwal

Hi there, I faced the same problem. I am running on Laradock to try out this demo provided by beyondcode. In my case, I got the same error due to the fact that port 6001 isn't expose to my localhost.

I am navigating similar issues and setting up various configuration and found something interesting.

Reference 1: https://github.com/beyondcode/laravel-websockets/issues/295 Reference 2: https://github.com/laradock/laradock/issues/2002#issuecomment-468884705

weec0008 avatar Mar 22 '20 08:03 weec0008

Hey,

not sure this helps you, but I had the same issue while setting the main project up as part of my project. I've resolved it by removing my entries for the allowed_origins entry in config/websockets.php. I've added those early on and regretted it later on.

Maybe this message helps someone in the same situation.

Cheers!

spekulatius avatar Oct 02 '20 15:10 spekulatius

its the same to me please let me know how to solve this problem. or will it be gone on live server?.

beagood8088 avatar Feb 25 '21 00:02 beagood8088

Same problem here, only on the development server, on localhost works with no problem.

pomirleanu avatar Nov 18 '21 14:11 pomirleanu

Changing the available data transfer protocols helped me:

enabledTransports: ['xhr_streaming']

Stereotip42 avatar Jan 10 '22 09:01 Stereotip42