From 032ce5bd07051ae7ec6edac4b3ba044fa4549e94 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Sat, 3 Apr 2021 00:17:20 +0000 Subject: [PATCH] fix channels in prod --- src/views/Dashboard.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/views/Dashboard.vue b/src/views/Dashboard.vue index a468078..fc73022 100644 --- a/src/views/Dashboard.vue +++ b/src/views/Dashboard.vue @@ -540,7 +540,8 @@ export default { methods: { setupWS() { console.log("Starting websocket"); - this.ws = new WebSocket(`ws://${this.wsUrl}/ws/dashinfo/?access_token=${this.token}`); + const proto = process.env.NODE_ENV === "production" ? "wss" : "ws"; + this.ws = new WebSocket(`${proto}://${this.wsUrl}/ws/dashinfo/?access_token=${this.token}`); this.ws.onopen = e => { console.log("Connected to ws"); };