From bbc6f0987b47d4cb321e75ec8c82aae80899c993 Mon Sep 17 00:00:00 2001 From: Andrew de Quincey Date: Tue, 20 Apr 2021 23:31:14 +0100 Subject: [PATCH] Clean up protocol --- public/assets/js/picoreflow.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/assets/js/picoreflow.js b/public/assets/js/picoreflow.js index 94afd4c..479b7b7 100644 --- a/public/assets/js/picoreflow.js +++ b/public/assets/js/picoreflow.js @@ -14,11 +14,11 @@ var temp_scale_display = "C"; var kwh_rate = 0.26; var currency_type = "EUR"; -var protocol = 'ws://'; +var protocol = 'ws:'; if (window.location.protocol == 'https:') { - protocol = 'wss://'; + protocol = 'wss:'; } -var host = "" + protocol + window.location.hostname + ":" + window.location.port; +var host = "" + protocol + "//" + window.location.hostname + ":" + window.location.port; var ws_status = new WebSocket(host+"/status"); var ws_control = new WebSocket(host+"/control"); var ws_config = new WebSocket(host+"/config");