fix: Fixed guac connection
Server Deploy / deploy (push) Successful in 1m22s

This commit is contained in:
2026-07-17 13:40:54 +01:00
parent 3dff45350b
commit 763eafa4f8
2 changed files with 7 additions and 4 deletions
+4 -2
View File
@@ -2,14 +2,16 @@
// The library attaches a global `Guacamole` object when loaded.
declare const Guacamole: any;
export function openConsole(container: HTMLElement, wsUrl: string): { disconnect: () => void } {
export function openConsole(container: HTMLElement, wsUrl: string, connectData = ""): { disconnect: () => void } {
// Guacamole's WebSocketTunnel builds the socket URL as `wsUrl + "?" + data`,
// so wsUrl must NOT already contain a query string — pass params via connectData.
const tunnel = new Guacamole.WebSocketTunnel(wsUrl);
const client = new Guacamole.Client(tunnel);
container.innerHTML = "";
container.appendChild(client.getDisplay().getElement());
client.connect("");
client.connect(connectData);
// Wire keyboard + mouse.
const mouse = new Guacamole.Mouse(client.getDisplay().getElement());