Skip to content

Commit

Permalink
use current window location protocol instead of always https
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kus committed Feb 24, 2021
1 parent e558035 commit 6181ebe
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,10 @@ Vue.filter('bytes', function (value) {
return `${value} bytes`;
})

const wsProtocol = window.location.protocol === "https:" ? "wss" : "ws";
let config = {
API_URI: process.env.VUE_APP_API_URI || `https://${window.location.host}/v1`,
WS_URI: process.env.VUE_APP_WS_URI || `wss://${window.location.host}/v1/ws`,
API_URI: process.env.VUE_APP_API_URI || `${window.location.protocol}//${window.location.host}/v1`,
WS_URI: process.env.VUE_APP_WS_URI || `${wsProtocol}//${window.location.host}/v1/ws`,
HOME_PAGE: 'home'
}

Expand Down

0 comments on commit 6181ebe

Please sign in to comment.