fix channels in prod

This commit is contained in:
wh1te909
2021-04-03 00:17:20 +00:00
parent 815199be81
commit 032ce5bd07

View File

@@ -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");
};