fix: websocket url
This commit is contained in:
parent
52c7d9eafb
commit
efbcd10fb0
@ -14,12 +14,7 @@ class Channel {
|
|||||||
|
|
||||||
// reload = function to use when we receive a message
|
// reload = function to use when we receive a message
|
||||||
async connect(reload) {
|
async connect(reload) {
|
||||||
let url = `
|
let url = `${window.location.protocol[4] === 's' ? 'wss' : 'ws'}://${window.location.host}/ws/chat/${this.channel_id}`;
|
||||||
${window.location.protocol == 'https' ? 'wss' : 'ws'}
|
|
||||||
://${window.location.host}
|
|
||||||
/ws/chat/
|
|
||||||
${this.channel_id}/
|
|
||||||
`;
|
|
||||||
|
|
||||||
this.chatSocket = new WebSocket(url);
|
this.chatSocket = new WebSocket(url);
|
||||||
this.chatSocket.onmessage = (event) =>{
|
this.chatSocket.onmessage = (event) =>{
|
||||||
|
@ -19,12 +19,7 @@ class MatchMaking
|
|||||||
if (!await this.client.isAuthentificate())
|
if (!await this.client.isAuthentificate())
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
let url = `
|
let url = `${window.location.protocol[4] === 's' ? 'wss' : 'ws'}://${window.location.host}/ws/matchmaking/${mode}`;
|
||||||
${window.location.protocol == 'https' ? 'wss' : 'ws'}
|
|
||||||
://${window.location.host}
|
|
||||||
/ws/matchmaking/
|
|
||||||
${mode}
|
|
||||||
`;
|
|
||||||
|
|
||||||
this._socket = new WebSocket(url);
|
this._socket = new WebSocket(url);
|
||||||
|
|
||||||
|
@ -77,12 +77,10 @@ class Tourmanent
|
|||||||
if (!await this.client.isAuthentificate())
|
if (!await this.client.isAuthentificate())
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
let url = `
|
console.log(window.location.protocol);
|
||||||
${window.location.protocol == 'https' ? 'wss' : 'ws'}
|
let url = `${window.location.protocol[4] === 's' ? 'wss' : 'ws'}://${window.location.host}/ws/tournaments/${this.id}`;
|
||||||
://${window.location.host}
|
|
||||||
/ws/tournaments/
|
console.log(url);
|
||||||
${this.id}
|
|
||||||
`;
|
|
||||||
|
|
||||||
this._socket = new WebSocket(url);
|
this._socket = new WebSocket(url);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user