Merge pull request #20 from adq/ssl

Ssl support
This commit is contained in:
Jason Bruce 2021-05-02 10:26:54 -04:00 committed by GitHub
commit 2674cff92b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,7 +14,11 @@ var temp_scale_display = "C";
var kwh_rate = 0.26;
var currency_type = "EUR";
var host = "ws://" + window.location.hostname + ":" + window.location.port;
var protocol = 'ws:';
if (window.location.protocol == 'https:') {
protocol = 'wss:';
}
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");