
client disconnected error. 
ping text message should do the trick. You'd just need to modify your server code to ignore that message.https://websockets.readthedocs.io/en/stable/topics/keepalive.html
Browsers don’t enable a keepalive mechanism like websockets by default. As a consequence, they can fail to notice that a WebSocket connection is broken for an extended period of time, until the TCP connection times out. [...]
Unfortunately, the WebSocket API in browsers doesn’t expose the native Ping and Pong functionality in the WebSocket protocol. You have to roll your own in the application layer.


client disconnectedping