rm keys
[henge/kiak.git] / host.js
1 const body = document.createElement('body')
2 const root = document.createElement('div')
3 document.title = "Strapp.io Host"
4 if ("WebSocket" in window) {
5 const wsock = new WebSocket("wss://" + _strapp_host + ":" + _strapp_port)
6 wsock.onopen = () => {
7 console.log("Strapped to wss://" + _strapp_host + ":" + _strapp_port)
8 }
9 wsock.onmessage = (evt) => {
10 console.log("Incoming connection from " + evt.data)
11 console.log("TODO: Open a socket to this client")
12 }
13 } else {
14 root.appendChild(document.createTextNode("Your browser does not support Strapp"))
15 }
16 body.appendChild(root)
17 document.body = body