diff --git a/htdocs/map.js b/htdocs/map.js index c912a14d..95cfa97b 100644 --- a/htdocs/map.js +++ b/htdocs/map.js @@ -13,7 +13,7 @@ var expectedLocator; if (query.locator) expectedLocator = query.locator; - var protocol = window.location.protocol == 'https' ? 'wss' : 'ws'; + var protocol = window.location.protocol.match(/https/) ? 'wss' : 'ws'; var href = window.location.href; var index = href.lastIndexOf('/'); diff --git a/htdocs/openwebrx.js b/htdocs/openwebrx.js index b30a6050..25c094c0 100644 --- a/htdocs/openwebrx.js +++ b/htdocs/openwebrx.js @@ -1526,7 +1526,7 @@ function on_ws_error() { var ws; function open_websocket() { - var protocol = window.location.protocol == 'https' ? 'wss' : 'ws'; + var protocol = window.location.protocol.match(/https/) ? 'wss' : 'ws'; var href = window.location.href; var index = href.lastIndexOf('/');