Skip to content

Commit ba4a003

Browse files
bnpatel1990Patel, Bhavdeep
andauthored
Fetch protocol from browser (#153)
Co-authored-by: Patel, Bhavdeep <[email protected]>
1 parent 7463120 commit ba4a003

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ const store = require('./store').default;
2121

2222

2323
(async () => {
24-
const response = await axios.get(`http://${window.location.hostname}:${window.location.port}/api/ports`);
24+
const response = await axios.get(`${window.location.protocol}//${window.location.hostname}:${window.location.port}/api/ports`);
2525
const data = await response.data;
2626
Vue.use(new VueSocketIO({
2727
debug: true,
28-
connection: `http://${window.location.hostname}:${data.wsPort}`,
28+
connection: `${window.location.protocol}//${window.location.hostname}:${data.wsPort}`,
2929
vuex: {
3030
store,
3131
actionPrefix: 'SOCKET_',

0 commit comments

Comments
 (0)