diff --git a/wled00/data/index.js b/wled00/data/index.js index f8359d0e2..c3ef0c5da 100644 --- a/wled00/data/index.js +++ b/wled00/data/index.js @@ -1000,7 +1000,7 @@ function reconnectWS() { function makeWS() { if (ws) return; - ws = new WebSocket('ws://'+(loc?locip:window.location.hostname)+'/ws'); + ws = new WebSocket((window.location.protocol == 'https:'?'wss':'ws')+'://'+(loc?locip:window.location.hostname)+'/ws'); ws.binaryType = "arraybuffer"; ws.onmessage = function(event) { if (event.data instanceof ArrayBuffer) return; //liveview packet diff --git a/wled00/data/liveviewws.htm b/wled00/data/liveviewws.htm index 9ad2a667d..9234d317c 100644 --- a/wled00/data/liveviewws.htm +++ b/wled00/data/liveviewws.htm @@ -51,7 +51,7 @@ ws.send("{'lv':true}"); } else { console.info("Peek WS opening"); - ws = new WebSocket("ws://"+document.location.host+"/ws"); + ws = new WebSocket((window.location.protocol == "https:"?"wss":"ws")+"://"+document.location.host+"/ws"); ws.onopen = function () { console.info("Peek WS open"); ws.send("{'lv':true}");