TLS check

This commit is contained in:
Hri7566 2023-09-09 01:35:35 -04:00
parent 9181370a82
commit f5b708aceb
1 changed files with 5 additions and 3 deletions

View File

@ -1148,11 +1148,13 @@ $(function () {
if (channel_id.substr(0, 1) == "#") channel_id = channel_id.substr(1); if (channel_id.substr(0, 1) == "#") channel_id = channel_id.substr(1);
if (channel_id == "") channel_id = "lobby"; if (channel_id == "") channel_id = "lobby";
var wssport = const isSecure = globalThis.location.protocol == "https:";
const port =
window.location.hostname == "www.multiplayerpiano.com" ? 443 : 8443; window.location.hostname == "www.multiplayerpiano.com" ? 443 : 8443;
var gClient = new Client( const gClient = new Client(
"wss://" + window.location.hostname + ":" + wssport (isSecure ? "wss://" : "ws://") + window.location.hostname + ":" + port
); );
gClient.setChannel(channel_id); gClient.setChannel(channel_id);
gClient.start(); gClient.start();