What does “WebSocket is closed before the connection is established” mean?

前端 未结 1 676
北荒
北荒 2020-12-01 10:54

I\'m using JavaScript and the Union platform How would I go about diagnosing this problem? Many thanks.

相关标签:
1条回答
  • 2020-12-01 11:05

    If you go to http://jsbin.com/ekusep/6/edit and view the JavaScript console you'll see the 'WebSocket is closed before the connection is established' logged. I've tested this in Chrome.

    In this code what it means is that ws.close() was called (by user code) before the connection was even given a chance to be established.

    So, the cause of this error is if code attempts to close the WebSocket connection before it's had a chance to actually connect.

    0 讨论(0)
提交回复
热议问题