X-Git-Url: https://git.kengrimes.com/?p=henge%2Fkiak.git;a=blobdiff_plain;f=host.js;h=95d3cc644bdd9c38787106592c7921ec231dcfb1;hp=9981cc9596819d9a267d21ec095b417081956c21;hb=60d1eef63f2f49d07f5d351f14fe1f7a14abb489;hpb=c405e114390a749a4fbd0cd530c258a8fc60b245 diff --git a/host.js b/host.js index 9981cc9..95d3cc6 100644 --- a/host.js +++ b/host.js @@ -2,9 +2,9 @@ document.title = "Strapp.io Host" const clients = [] if ("WebSocket" in window) { document.addEventListener('DOMContentLoaded', (event) => { - const wsock = new WebSocket("wss://" + window.location.host + ":" + _strapp_port) + const wsock = new WebSocket(`${_strapp_protocol}://${window.location.hostname}:${_strapp_port}`) wsock.onopen = () => { - console.log("Strapped to wss://" + window.location.host + ":" + _strapp_port) + console.log(`Strapped to ${_strapp_protocol}://${window.location.hostname}:${_strapp_port}`) } wsock.onmessage = (evt) => { console.log("Incoming connection from " + evt.data)