   def onclose(event):
        print(event.type)
        document.documentElement.classList.add("ok")

    ws = WebSocket(
      url="ws://localhost:5037/",
      onopen=onopen,
      onmessage=onmessage,
      onclose=onclose
    )
  </script>
</body>
</html>
