Skip to content

Commit

Permalink
Update WebSocket URI detection
Browse files Browse the repository at this point in the history
  • Loading branch information
Hri7566 committed Feb 1, 2024
1 parent 0f21e39 commit 6d894d1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -1149,8 +1149,9 @@ $(function () {
if (channel_id == "") channel_id = "lobby";

const protocol = location.protocol == "https:" ? "wss:" : "ws:";
const wssport =
window.location.hostname == "www.multiplayerpiano.dev" ? 443 : 8443;
const wssport = window.location.hostname.includes("multiplayerpiano.dev")
? 443
: 8443;
const gClient = new Client(`${protocol}//${location.hostname}:${wssport}`);
gClient.setChannel(channel_id);
gClient.start();
Expand Down

0 comments on commit 6d894d1

Please sign in to comment.