Firebase - WebSocket closes before the connection is established.

Just starting with Firebase (a great BTW concept) and I notice that in the Chrome console it reports that "WebSocket is closed before the connection is established"

It still works, but wondered why this could happen - does it need to be bothered?

Interestingly, this means that there is a successful connection to websites.

thanks

+4
source share
2 answers

This is a known issue. The Firebase client attempts to establish a real-time connection to Firebase servers using several methods. If one of these methods succeeds before Websocket does, we will cancel Websocket and you will see this warning. You can safely ignore the error.

+6
source

I fixed this problem for several weeks and could reproduce it sequentially. Sometimes I get a WebSocket is closed warning, another time it is an actual error:

Connection to WebSocket with 'wss: //s-usc1c-nss-214.firebaseio.com/.ws? v = 5 & ns = foo 'failed: WebSocket session timeout

You had a long chain of email with support. They stated that “there should not be so much time to establish a connection just like your application”, and that “it looks like it is outside the Google network, and without any additional data it’s just, maybe just a normal Internet compound".

But I agree with @Xi Xiao above that "freezing for 30 seconds is not a suitable solution." I created a GitHub problem by describing the problem in detail and proposing a couple of solutions.

+1
source

Source: https://habr.com/ru/post/1434160/


All Articles