summaryrefslogtreecommitdiff
path: root/web/share/js/kvm
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2021-05-17 10:40:20 +0300
committerDevaev Maxim <[email protected]>2021-05-17 10:40:20 +0300
commit274d609b71de508d66b96baa24ad80ad8b4885eb (patch)
treee23bb955769ce7904e1c2d3d174071760a864578 /web/share/js/kvm
parenta4c9a0b117e7805129bf19d31ba9f7166622c579 (diff)
refactoring
Diffstat (limited to 'web/share/js/kvm')
-rw-r--r--web/share/js/kvm/session.js3
1 files changed, 1 insertions, 2 deletions
diff --git a/web/share/js/kvm/session.js b/web/share/js/kvm/session.js
index 894dc6f1..b8fee992 100644
--- a/web/share/js/kvm/session.js
+++ b/web/share/js/kvm/session.js
@@ -205,8 +205,7 @@ export function Session() {
let http = tools.makeRequest("GET", "/api/auth/check", function() {
if (http.readyState === 4) {
if (http.status === 200) {
- let proto = (location.protocol === "https:" ? "wss" : "ws");
- __ws = new WebSocket(`${proto}://${location.host}/api/ws`);
+ __ws = new WebSocket(`${tools.https ? "wss" : "ws"}://${location.host}/api/ws`);
__ws.onopen = __wsOpenHandler;
__ws.onmessage = __wsMessageHandler;
__ws.onerror = __wsErrorHandler;