fix: support macOS VNC connections (#1311)

This commit is contained in:
ZacharyZcR
2026-08-24 03:59:37 +08:00
committed by GitHub
parent ad266956cc
commit fa0fa7f836
6 changed files with 225 additions and 20 deletions
+23 -1
View File
@@ -132,12 +132,34 @@ describe("buildOriginWsUrl", () => {
localPort: 30009,
localPath: "/docker/console/",
remotePath: "/docker/console/",
includeLocalJwt: false,
includeJwt: false,
});
expect(url).toBe("ws://127.0.0.1:30009/docker/console/");
});
it("does not duplicate the Guacamole token on remote connections", async () => {
win.electronAPI = {
invoke: async (channel: string) => {
if (channel === "get-remote-sync-config") {
return { serverUrl: "https://termix.example" };
}
if (channel === "get-remote-sync-jwt") return "remote-jwt";
return null;
},
};
const url = await buildOriginWsUrl({
origin: "remote",
localPort: 30008,
localPath: "/guacamole/websocket/",
remotePath: "/guacamole/websocket/",
includeJwt: false,
});
expect(url).toBe("wss://termix.example/guacamole/websocket/");
});
it("leaves the URL alone when there is no token stored", async () => {
delete store.jwt;