-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
WebSocket is closed before the connection is established #353
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
What browser? Was the WebSocket connected when you refreshed? If not, this could just be a browser warning. |
Have you tried ending the socket connection before refreshing the page? There is a similar issue to this on the Primus Issue Tracker: primus/primus#398 The suggested workaround there is to do the following:
|
@brycekahle Google Chrome on OSX. Yeah when i refresh the page, it will connect. @Southpaw17 Thanks for your hint. What's equivalent code in sockjs-client? Should I use Primus library to overcome this issue? Thanks. |
@majeedsan It does appear we will close the websocket on sockjs-client/lib/transport/websocket.js Lines 43 to 46 in 4027289
|
Unfortunately we don't have any other way to stop the websocket from continuing the connection attempt (other than relying on the browser to stop it) on page unload. I think it is safe to ignore the browser warning. What do you think? |
We have the same problem (though through a couple layers of indirection because we're seeing it from angular webpack) but it happens 100% of the time. Repro steps:
|
This issue has been inactive for 30 days. It will be in closed in 5 days without any new activity. |
Hi guys, thank you for your awesome library.
I've used sockjs-client for connecting my web app to a spring websocket web server, the problem is that when i refresh related browser page, sometimes (about 5%) this error will happen.
WebSocket connection to 'ws://localhost:4568/ws/379/lsb17jhg/websocket?X....' failed: WebSocket is closed before the connection is established
maybe useful to say that I didnt call disconnect or close anywhere in my code.
Thank you.
The text was updated successfully, but these errors were encountered: