Sha256: 8ea0c3f39a67bf3b1eb1ec2dc17c56a365f987c4bc2c83aaa7319b9f68b4e410

Contents?: true

Size: 1.06 KB

Versions: 22

Compression:

Stored size: 1.06 KB

Contents

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

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

    window.onload = connect;
  </script>
  <h1 id="status">disconnected</h1>
  <h1 id="msg"></h1>
</body>
</html>

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
tipi-0.55 df/ws_page.html
tipi-0.54 df/ws_page.html
tipi-0.53 df/ws_page.html
tipi-0.52 df/ws_page.html
tipi-0.51 df/ws_page.html
tipi-0.50 df/ws_page.html
tipi-0.49 df/ws_page.html
tipi-0.47 df/ws_page.html
tipi-0.46 df/ws_page.html
tipi-0.45 df/ws_page.html
tipi-0.43 df/ws_page.html
tipi-0.42 df/ws_page.html
tipi-0.41 df/ws_page.html
tipi-0.40 df/ws_page.html
tipi-0.39 df/ws_page.html
tipi-0.38 df/ws_page.html
tipi-0.37.2 df/ws_page.html
tipi-0.37.1 df/ws_page.html
tipi-0.37 df/ws_page.html
tipi-0.36 df/ws_page.html