;
        ws.onclose = function(event) {
          debug("Closed - code: " + event.code + ", reason: " + event.reason + ", wasClean: " + event.wasClean);
        };
        ws.onopen = function() {
          debug("connected...");
          ws.send("hello server");
          ws.send("hello again");
        };
      };
    </script>
  </head>
  <body onload="init();">
    <div id="debug"></div>
  </body>
</html>
