mirror of
https://github.com/Shik3i/KoalaSync.git
synced 2026-08-21 16:36:44 +00:00
Applied Final Polish optimizations: SPA navigation fix, UI throttling, and Strict WSS
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user