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