Fix more electron APi routes and issues

This commit is contained in:
LukeGus
2025-09-11 17:18:44 -05:00
parent a4ca1512fc
commit 54fb8ffc24
8 changed files with 116 additions and 33 deletions

View File

@@ -212,7 +212,7 @@ export const Terminal = forwardRef<any, SSHTerminalProps>(function SSHTerminal(
const baseUrl = (window as any).configuredServerUrl || 'http://127.0.0.1:8081';
// Convert HTTP/HTTPS to WS/WSS and use nginx reverse proxy path
const wsProtocol = baseUrl.startsWith('https://') ? 'wss://' : 'ws://';
const wsHost = baseUrl.replace(/^https?:\/\//, '').replace(/:\d+$/, ''); // Remove port if present
const wsHost = baseUrl.replace(/^https?:\/\//, ''); // Keep the port
return `${wsProtocol}${wsHost}/ssh/websocket/`;
})()
: `${window.location.protocol === 'https:' ? 'wss' : 'ws'}://${window.location.host}/ssh/websocket/`;