summaryrefslogtreecommitdiff
path: root/src/store
diff options
context:
space:
mode:
authorVitalii Lysak <v.lysak@dunice.net>2022-08-30 10:54:30 +0300
committerVitalii Lysak <v.lysak@dunice.net>2022-08-30 10:54:30 +0300
commita7830e9bfb3e0d3988765301f84945328dc51434 (patch)
treea6ef87a6f4b205e80384042d2cec80945a7ec6d4 /src/store
parent33481889c903582e45d9beabc66eac0fe021863b (diff)
parent53053c00715b33ba83b055cb7c0f6bec629d7689 (diff)
downloadwebui-vue-a7830e9bfb3e0d3988765301f84945328dc51434.tar.xz
Merge branch 'sila' of git.sila.ru:pub/openbmc/webui-vue into sila
Diffstat (limited to 'src/store')
-rw-r--r--src/store/plugins/WebSocketPlugin.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/store/plugins/WebSocketPlugin.js b/src/store/plugins/WebSocketPlugin.js
index cbdc9329..afad6718 100644
--- a/src/store/plugins/WebSocketPlugin.js
+++ b/src/store/plugins/WebSocketPlugin.js
@@ -22,7 +22,9 @@ const WebSocketPlugin = (store) => {
process.env.VUE_APP_SUBSCRIBE_SOCKET_DISABLED === 'true' ? true : false;
if (socketDisabled) return;
const token = store.getters['authentication/token'];
- ws = new WebSocket(`wss://${window.location.host}/subscribe`, [token]);
+ const url = new URL('/subscribe', window.location.href);
+ url.protocol = url.protocol.replace('http', 'ws');
+ ws = new WebSocket(url, [token]);
ws.onopen = () => {
ws.send(JSON.stringify(data));
};