Javascript: WebSocketClosedEventArgs.reason Property
Description
The reason the server closed the connection. This is specific to the particular server and sub-protocol.
Syntax
<string> WebSocketClosedEventArgs.reasonExamples
The following example demonstrates WebSocketClosedEventArgs.reason in a practical document-editing workflow. The reason the server closed the connection. This is specific to the particular server and sub-protocol.
function inspectReason(webSocketClosedEventArgs) {
const reason = webSocketClosedEventArgs.reason;
console.log("reason:", reason);
}