On Silver challenge

Silver challenge comprises of two parts:

  1. Recognize and simply react (notify user) on client WebSocket disconnection (.onclose handler ) or error with the socket (.onerror handler )
    MDN WebSocket.onclose
    MDN WebSocket.onerror
  2. Reconnect several times either automatically, or after user positively responded to JavaScript confirm(‘Disconnected, Do you wish to reconnect’).
    intensively uses setInterval() and webSocket state, from here:
    MDN WebSocket.readyState