Files
Termix/plugins/remote-desktop/tests/backend/jump-tunnel-endpoint.test.ts
T

28 lines
829 B
TypeScript
Raw Normal View History

+3
2026-08-06 14:41:39 -05:00
import { describe, expect, it } from "vitest";
2026-10-01 16:20:16 -05:00
import { resolveJumpTunnelEndpoint } from "../../src/backend/jump-tunnel-endpoint.js";
+3
2026-08-06 14:41:39 -05:00
describe("resolveJumpTunnelEndpoint", () => {
it("keeps an in-process guacd tunnel on loopback", () => {
expect(resolveJumpTunnelEndpoint("localhost")).toEqual({
bindHost: "127.0.0.1",
advertisedHost: "127.0.0.1",
});
});
it("exposes the tunnel to a separate guacd container", () => {
expect(resolveJumpTunnelEndpoint("guacd")).toEqual({
bindHost: "0.0.0.0",
advertisedHost: "termix",
});
});
it("supports a custom backend hostname for external guacd", () => {
expect(
resolveJumpTunnelEndpoint("guacd.example", "termix-backend"),
).toEqual({
bindHost: "0.0.0.0",
advertisedHost: "termix-backend",
});
});
});