Sha256: 5227a1ff61e7eb51c4e4410c2eaa851fc7e29fcd6587464219aae9fa50ef4ffc

Contents?: true

Size: 883 Bytes

Versions: 8

Compression:

Stored size: 883 Bytes

Contents

<!doctype html>
<html lang="en">
<head>
  <title>Websocket Client</title>
</head>
<body>
  <script>
    var connect = function () {
      var exampleSocket = new WebSocket("wss://dev.realiteq.net/");

      exampleSocket.onopen = function (event) {
        document.querySelector('#status').innerText = 'connected';
        exampleSocket.send("Can you hear me?");
      };
      exampleSocket.onclose = function (event) {
        document.querySelector('#status').innerText = 'disconnected';
        setTimeout(function () {
          // exampleSocket.removeAllListeners();
          connect();
        }, 1000);
      }
      exampleSocket.onmessage = function (event) {
        document.querySelector('#msg').innerText = event.data;
        console.log(event.data);
      }
    };

    connect();
  </script>
  <h1 id="status">disconnected</h1>
  <h1 id="msg"></h1>
</body>
</html>

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
tipi-0.39 examples/ws_page.html
tipi-0.38 examples/ws_page.html
tipi-0.37.2 examples/ws_page.html
tipi-0.37.1 examples/ws_page.html
tipi-0.37 examples/ws_page.html
tipi-0.36 examples/ws_page.html
tipi-0.35 examples/ws_page.html
tipi-0.34 examples/ws_page.html