<!DOCTYPE html>
<html lang="en">
  <body>
    <h1>Data push over WebSocket demo</h1>
    <div style="margin-top: 1em;">Event log:</div>
    <div id="log" style="background: #eee; height: 10em; padding: 0.5em; overflow:auto;"></div>
    </body>
  <script>
    var log = document.getElementById('log');

    const watch = function() {
    var l = window.location, proto = l.protocol.replace('http', 'ws');
    var tid, wsURI = proto + '//' + l.host + '/api/watch'
    var reconnect = function() {
      var ws = ne