route desktop guacd calls to the connected remote server (#1122)

resolveConnectionOrigin() pins RDP/VNC/Telnet to "remote" because the embedded
desktop backend does not bundle guacd, and the Guacamole websocket already
follows that. The status check and both token calls did not: they use the shared
authApi, which in Electron is hard-coded to the embedded backend.

So the desktop app asked the backend without guacd whether guacd was available,
got "disconnected", and refused to connect — while the connected server it would
actually have used reports it as connected and serves the same host fine from the
web client.

Send those three calls through a remote-origin instance in Electron, alongside
the existing file-manager, tunnel and stats ones.

Closes Termix-SSH/Support#1043
This commit is contained in:
ZacharyZcR
2026-07-28 01:49:05 +08:00
committed by GitHub
parent 1d26f820c6
commit 60109be10f
3 changed files with 117 additions and 12 deletions
+8
View File
@@ -763,6 +763,7 @@ function createRemoteOriginApiInstance(path: string): AxiosInstance {
let remoteFileManagerApi: AxiosInstance | null = null;
let remoteTunnelApi: AxiosInstance | null = null;
let remoteStatsApi: AxiosInstance | null = null;
let remoteGuacamoleApi: AxiosInstance | null = null;
export function getRemoteFileManagerApi(): AxiosInstance {
if (!remoteFileManagerApi) {
@@ -785,6 +786,13 @@ export function getRemoteStatsApi(): AxiosInstance {
return remoteStatsApi;
}
export function getRemoteGuacamoleApi(): AxiosInstance {
if (!remoteGuacamoleApi) {
remoteGuacamoleApi = createRemoteOriginApiInstance("");
}
return remoteGuacamoleApi;
}
// Maps a live SSH session (keyed by sessionId, which today is the host's
// numeric id as a string -- see ensureSSHSessionForHost) to the resolved
// origin it was connected through, so every subsequent file-manager call