Skip to content

Commit

Permalink
fix ws protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
keshav2010 committed Apr 30, 2024
1 parent 5b6a7d5 commit 7d1178a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion public/NetworkManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ export class NetworkManager {
phaserGame: Phaser.Game,
phaserRegistry: Phaser.Data.DataManager
) {
this.client = new Colyseus.Client(`ws://${URL}`);
const protocol = window.location.protocol.includes('http') ? 'ws' : 'wss';
this.client = new Colyseus.Client(`${protocol}://${URL}`);
this.room = null;

this.game = phaserGame;
Expand Down

0 comments on commit 7d1178a

Please sign in to comment.