Applied Final Polish optimizations: SPA navigation fix, UI throttling, and Strict WSS

This commit is contained in:
Timo
2026-04-22 08:57:22 +02:00
parent 5cfc9d4047
commit 0d7e5e7fc7
3 changed files with 30 additions and 0 deletions
+8
View File
@@ -75,6 +75,14 @@ async function connect() {
if (!finalUrl.includes('://')) {
finalUrl = 'ws://' + finalUrl;
}
// Strict WSS Enforcement
const urlObj = new URL(finalUrl);
const isLocal = urlObj.hostname === 'localhost' || urlObj.hostname === '127.0.0.1';
if (!isLocal && urlObj.protocol === 'ws:') {
finalUrl = finalUrl.replace('ws://', 'wss://');
addLog('Security: Upgraded to wss:// for remote host.', 'warn');
}
}
addLog(`Connecting to ${isCustomServer ? finalUrl : 'Official Server'}...`, 'info');