X-Git-Url: https://git.kengrimes.com/?p=henge%2Fkiak.git;a=blobdiff_plain;f=host.js;fp=host.js;h=2700506af93a3f0f84b9ddc177bab3419bdcc5f7;hp=0000000000000000000000000000000000000000;hb=69adc9a3512752d627e126dde85c859fcba9fb63;hpb=d37eeff687a6a392fb574e602940b4e96b828aea diff --git a/host.js b/host.js new file mode 100644 index 0000000..2700506 --- /dev/null +++ b/host.js @@ -0,0 +1,17 @@ +const body = document.createElement('body') +const root = document.createElement('div') +document.title = "Strapp.io Host" +if ("WebSocket" in window) { + const wsock = new WebSocket("wss://" + _strapp_host + ":" + _strapp_port) + wsock.onopen = () => { + console.log("Strapped to wss://" + _strapp_host + ":" + _strapp_port) + } + wsock.onmessage = (evt) => { + console.log("Incoming connection from " + evt.data) + console.log("TODO: Open a socket to this client") + } +} else { + root.appendChild(document.createTextNode("Your browser does not support Strapp")) +} +body.appendChild(root) +document.body = body