diff --git a/public/default/config.js b/public/default/config.js index 7696cf78..2b68f927 100644 --- a/public/default/config.js +++ b/public/default/config.js @@ -10,12 +10,19 @@ * */ (function () { - // host = ip:port - // const host = '192.168.8.100:33030'; - const host = `${window.location.hostname}:33030`; + // baseUrl = protocol://ip:port + // baseUrl = 'http://192.168.8.100:33030'; + const protocol = window.location.protocol + let wsprotocol = "ws:" + const hostname = window.location.hostname + let host = `${hostname}:33030`; + if (protocol === 'https:') { + host = `${hostname}:33443`; + wsprotocol = "wss:" + } // Service Address - sessionStorage.setItem('baseUrl', `http://${host}`); + sessionStorage.setItem('baseUrl', `${protocol}//${host}`); // websocket Address - sessionStorage.setItem('wsUrl', `ws://${host}`); + sessionStorage.setItem('wsUrl', `${wsprotocol}//${host}`); })();