using https with self-signed cert

This commit is contained in:
Devaev Maxim
2018-08-09 04:06:44 +03:00
parent f71788bb35
commit e3f5d1e4d6
4 changed files with 38 additions and 22 deletions

View File

@@ -20,7 +20,7 @@ var session = new function() {
};
this.startPoller = function() {
__ws = new WebSocket("ws://" + location.host + "/kvmd/ws");
__ws = new WebSocket((location.protocol == "https:" ? "wss" : "ws") + "://" + location.host + "/kvmd/ws");
__ws.onopen = __wsOpenHandler;
__ws.onmessage = __wsMessageHandler;
__ws.onerror = __wsErrorHandler;