Mixed content exception in web browser in websocket communication on peek behind an https backproxy. (#2571)

"ws://" must be the change to the "wss://" for encryption
This commit is contained in:
PLCHome 2022-03-07 18:26:53 +01:00 committed by GitHub
parent 961d5591bd
commit b01309c3bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -1000,7 +1000,7 @@ function reconnectWS() {
function makeWS() { function makeWS() {
if (ws) return; 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.binaryType = "arraybuffer";
ws.onmessage = function(event) { ws.onmessage = function(event) {
if (event.data instanceof ArrayBuffer) return; //liveview packet if (event.data instanceof ArrayBuffer) return; //liveview packet

View File

@ -51,7 +51,7 @@
ws.send("{'lv':true}"); ws.send("{'lv':true}");
} else { } else {
console.info("Peek WS opening"); 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 () { ws.onopen = function () {
console.info("Peek WS open"); console.info("Peek WS open");
ws.send("{'lv':true}"); ws.send("{'lv':true}");