remote server prototype
[henge/kiak.git] / remote-server.html
1 <!DOCTYPE HTML>
2 <html>
3 <head>
4 <script type="text/javascript">
5 function testStrapp() {
6 document.getElementById("strapp-admin").innerHTML = "Dead"
7 if ("WebSocket" in window) {
8 const wsock = new WebSocket("wss://$HOST:$PORT")
9 wsock.onopen = () => {
10 wsock.send("Test message")
11 document.getElementById("strapp-admin").innerHTML = "Sent test"
12 }
13 wsock.onmessage = (evt) => {
14 document.getElementById("strapp-admin").innerHTML = "Got Response\r\n" + evt.data
15 }
16 }
17 else {
18 document.getElementById("strapp-admin").innerHTML = "Your browser does not support Strapp"
19 }
20 }
21 </script>
22 </head>
23 <body onload="javascript:testStrapp()">
24 <div id="strapp-admin">
25 Unterminated
26 </div>
27 </body>
28 </html>