You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a websocket is closed by the remote client, is there a way to identify the connection close status code?, I am implementing a reconnection feature & it is important to identify if it is a clean close or a abrupt failure. Websockt spec defines these codes https://datatracker.ietf.org/doc/html/rfc6455#section-7.4.1 7 & browsers do implement these status codes. SockJs server also sends codes such as 3000 Go away, which gets propagated to browsers onClose event.
When a websocket is closed by the remote client, is there a way to identify the connection close status code?, I am implementing a reconnection feature & it is important to identify if it is a clean close or a abrupt failure. Websockt spec defines these codes
https://datatracker.ietf.org/doc/html/rfc6455#section-7.4.1 7 & browsers do implement these status codes. SockJs server also sends codes such as 3000 Go away, which gets propagated to browsers onClose event.
Eg:
Javascript on close event payload
{
"type": "close",
"bubbles": false,
"cancelable": false,
"timeStamp": 1654833914457,
"wasClean": true,
"code": 3000,
"reason": "Go away!"
}
https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent/code
The text was updated successfully, but these errors were encountered: