add: websocket protocol now depends on http's

This commit is contained in:
AdrienLSH
2023-12-26 01:03:09 +01:00
parent 8ba55d5be2
commit 52c7d9eafb
3 changed files with 21 additions and 6 deletions

View File

@ -19,8 +19,13 @@ class MatchMaking
if (!await this.client.isAuthentificate())
return null;
let url = `wss://${window.location.host}/ws/matchmaking/${mode}`;
let url = `
${window.location.protocol == 'https' ? 'wss' : 'ws'}
://${window.location.host}
/ws/matchmaking/
${mode}
`;
this._socket = new WebSocket(url);
this.searching = true;
@ -49,4 +54,4 @@ class MatchMaking
}
}
export {MatchMaking}
export {MatchMaking}