Sha256: 86b7fa1599188e1e77a5fea351e29cad5722e080e87ea3157a6db419f091e1a6

Contents?: true

Size: 911 Bytes

Versions: 18

Compression:

Stored size: 911 Bytes

Contents

<!doctype html>
<html lang="en">
<head>
  <title>Websocket Client</title>
</head>
<body>
  <script>
    var connect = function () {
      var exampleSocket = new WebSocket("ws://localhost:1234");

      exampleSocket.onopen = function (event) {
        document.querySelector('#status').innerText = 'connected';
        exampleSocket.send("Can you hear me?");
      };
      exampleSocket.onclose = function (event) {
        console.log('onclose');
        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

18 entries across 18 versions & 3 rubygems

Version Path
tipi-0.33 examples/ws_page.html
tipi-0.32 examples/ws_page.html
tipi-0.31 examples/ws_page.html
tipi-0.30 examples/ws_page.html
polyphony-http-0.28 examples/ws_page.html
polyphony-http-0.27 examples/ws_page.html
polyphony-http-0.26 examples/ws_page.html
polyphony-http-0.25 examples/ws_page.html
polyphony-http-0.24 examples/ws_page.html
polyphony-0.23 examples/http/ws_page.html
polyphony-0.22 examples/http/ws_page.html
polyphony-0.21 examples/http/ws_page.html
polyphony-0.20 examples/http/ws_page.html
polyphony-0.19 examples/http/ws_page.html
polyphony-0.17 examples/http/ws_page.html
polyphony-0.16 examples/http/ws_page.html
polyphony-0.15 examples/http/ws_page.html
polyphony-0.14 examples/io/ws_page.html