Skip to content

Commit f7b7035

Browse files
committed
[bugfix] Support https/wss proxy
1 parent 681cf4f commit f7b7035

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/main.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,13 @@ if (process.env.NODE_ENV === 'development') {
1111
wsAddress = 'ws://localhost:8082/api/vision';
1212
} else {
1313
// UI and backend are served on the same host+port on production builds
14-
wsAddress = 'ws://' + window.location.hostname + ':' + window.location.port + '/api/vision';
14+
let protocol;
15+
if (window.location.protocol === 'http:') {
16+
protocol = 'ws:'
17+
} else {
18+
protocol = 'wss:'
19+
}
20+
wsAddress = protocol + '//' + window.location.hostname + ':' + window.location.port + '/api/vision';
1521
}
1622

1723
Vue.use(VueNativeSock, wsAddress, {

0 commit comments

Comments
 (0)