Added SSL to websockets js code as well

This commit is contained in:
Fabio Manganiello 2018-11-02 00:00:10 +01:00
parent 727b604bb4
commit 3eed774d50

View file

@ -9,7 +9,8 @@ $(document).ready(function() {
var initWebsocket = function() {
try {
websocket = new WebSocket('ws://' + window.location.hostname + ':' + window.websocket_port);
url_prefix = window.ssl_cert ? 'wss://' : 'ws://';
websocket = new WebSocket(url_prefix + window.location.hostname + ':' + window.websocket_port);
} catch (err) {
websocket = undefined;
return;