fix(webui): works now with https port 443 (#924)

* Websocket fix for SSL reverse proxies

* docs: add changelog

Co-authored-by: Sersch <edeltraud70@gmx.de>
This commit is contained in:
m33ts4k0z
2020-08-02 22:18:42 +02:00
committed by GitHub
parent 94c23653de
commit d1a2b77ce3
2 changed files with 8 additions and 2 deletions

View File

@@ -76,7 +76,13 @@ function initWebSocket()
{
if (window.websocket == null)
{
window.jsonPort = (document.location.port == '') ? '80' : document.location.port;
window.jsonPort = '';
if(document.location.port == '' && document.location.protocol == "http:")
window.jsonPort = '80';
else if (document.location.port == '' && document.location.protocol == "https:")
window.jsonPort = '443';
else
window.jsonPort = document.location.port;
window.websocket = (document.location.protocol == "https:") ? new WebSocket('wss://'+document.location.hostname+":"+window.jsonPort) : new WebSocket('ws://'+document.location.hostname+":"+window.jsonPort);
window.websocket.onopen = function (event) {