beyondcode / laravel-websockets-demo

Demo application to use with the Laravel WebSockets package.
https://docs.beyondco.de/laravel-websockets/
403 stars 164 forks source link

WebSocket is closed before the connection is established. #6

Closed playbert closed 10 months ago

playbert commented 5 years ago

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.

aeegvk commented 5 years ago

Having the same issues

jonnywilliamson commented 5 years ago

Yup. Getting this too.

Did either of you work out the issue?

PrasadChinwal commented 4 years ago

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

weec0008 commented 4 years ago

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

spekulatius commented 4 years ago

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!

beagood8088 commented 3 years ago

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

pomirleanu commented 2 years ago

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

Stereotip42 commented 2 years ago

Changing the available data transfer protocols helped me:

enabledTransports: ['xhr_streaming']