diff --git a/Ooui/Client.js b/Ooui/Client.js index f77d6e1..094aa1a 100644 --- a/Ooui/Client.js +++ b/Ooui/Client.js @@ -43,7 +43,11 @@ function ooui (rootElementPath) { var wsArgs = (rootElementPath.indexOf("?") >= 0 ? "&" : "?") + "w=" + initialSize.width + "&h=" + initialSize.height; - socket = new WebSocket ("ws://" + document.location.host + rootElementPath + wsArgs, "ooui"); + var proto = "ws"; + if (location.protocol == "https:") { + proto = "wss"; + } + socket = new WebSocket (proto + "://" + document.location.host + rootElementPath + wsArgs, "ooui"); socket.addEventListener ("open", function (event) { console.log ("Web socket opened");