property
WebSocket.onclose
onclose: null | (this: WebSocket, ev: CloseEvent) => any
Event handler for close event. Fires once the connection closes. code and reason come from the server's Close frame (1005 if the frame had no code). code is 1006 if the connection ended without a Close frame.