diff options
author | Alexandr Ilenko <AIlenko@IBS.RU> | 2022-08-22 18:33:14 +0300 |
---|---|---|
committer | Alexandr Ilenko <AIlenko@IBS.RU> | 2022-08-30 10:45:30 +0300 |
commit | f47ddcfeaa957dd6571b35e6ba7b761892f186db (patch) | |
tree | 4e825212486e6ce5f09c889cea316f75136e2193 /src/views/Operations/Kvm | |
parent | 0444ab4658743504ddf12ddf911158aebf9037ae (diff) | |
download | webui-vue-f47ddcfeaa957dd6571b35e6ba7b761892f186db.tar.xz |
[SILABMC-280] Fix: use wsS only when httpS
Diffstat (limited to 'src/views/Operations/Kvm')
-rw-r--r-- | src/views/Operations/Kvm/KvmConsole.vue | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/views/Operations/Kvm/KvmConsole.vue b/src/views/Operations/Kvm/KvmConsole.vue index c028a9fc..c9425cfd 100644 --- a/src/views/Operations/Kvm/KvmConsole.vue +++ b/src/views/Operations/Kvm/KvmConsole.vue @@ -105,12 +105,10 @@ export default { this.rfb = null; }, openTerminal() { + const url = new URL('/kvm/0', window.location.href); + url.protocol = url.protocol.replace('http', 'ws'); const token = this.$store.getters['authentication/token']; - this.rfb = new RFB( - this.$refs.panel, - `wss://${window.location.host}/kvm/0`, - { wsProtocols: [token] } - ); + this.rfb = new RFB(this.$refs.panel, url, { wsProtocols: [token] }); this.rfb.scaleViewport = true; this.rfb.clipViewport = true; |