If the web socket connection goes down, nothing will reconnect it again.
These calls:
websock.send(JSON.stringify(msg));
should be changed into a function call where the websock's state is checked and it should try to reconnect the socket before sending the message.
Perhaps queue the latest message so it can be sent after connection?
Have a html message displaying a message about not being connected to the server.
If the web socket connection goes down, nothing will reconnect it again.
These calls: websock.send(JSON.stringify(msg)); should be changed into a function call where the websock's state is checked and it should try to reconnect the socket before sending the message. Perhaps queue the latest message so it can be sent after connection?
Have a html message displaying a message about not being connected to the server.