property
ServerWebSocket.readyState
readonly readyState: WebSocketReadyState
The ready state of the client.
- if
0, the client is connecting. - if
1, the client is connected. - if
2, the client is closing. - if
3, the client is closed.
console.log(socket.readyState); // 1