Skip to content

Commit

Permalink
[bugfix] Support https/wss proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
g3force committed Jul 18, 2020
1 parent 681cf4f commit f7b7035
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@ if (process.env.NODE_ENV === 'development') {
wsAddress = 'ws://localhost:8082/api/vision';
} else {
// UI and backend are served on the same host+port on production builds
wsAddress = 'ws://' + window.location.hostname + ':' + window.location.port + '/api/vision';
let protocol;
if (window.location.protocol === 'http:') {
protocol = 'ws:'
} else {
protocol = 'wss:'
}
wsAddress = protocol + '//' + window.location.hostname + ':' + window.location.port + '/api/vision';
}

Vue.use(VueNativeSock, wsAddress, {
Expand Down

0 comments on commit f7b7035

Please sign in to comment.