if a remote name and type is specified, adapt the API endpoint base url accordingly, and do not send the authentication line, since there is no PDM termproxy that handles it. instead, PDM will generate and inject the authentication line when proxying the websocket connection to the termproxy on the remote.
Signed-off-by: Fabian Grünbichler <[email protected]> --- xterm.js/src/main.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/xterm.js/src/main.js b/xterm.js/src/main.js index 902a1c3..897540f 100644 --- a/xterm.js/src/main.js +++ b/xterm.js/src/main.js @@ -19,6 +19,8 @@ var term, state = states.start, starttime = new Date(); +var remote = getQueryParameter('remote'); +var remote_type = getQueryParameter('remote-type'); var type = getQueryParameter('console'); var vmid = getQueryParameter('vmid'); var vmname = getQueryParameter('vmname'); @@ -175,7 +177,11 @@ function createTerminal() { protocol = (location.protocol === 'https:') ? 'wss://' : 'ws://'; var params = {}; - var url = '/nodes/' + nodename; + var url = ''; + if (remote !== undefined && remote !== "") { + url += '/' + remote_type + '/remotes/' + remote; + } + url += '/nodes/' + nodename; switch (type) { case 'kvm': url += '/qemu/' + vmid; @@ -252,7 +258,10 @@ function runTerminal() { }, 250); }); - socket.send(PVE.UserName + ':' + ticket + "\n"); + // for remote sessions, this line needs to be sent by PDM + if (remote === undefined || remote === "") { + socket.send(PVE.UserName + ':' + ticket + "\n"); + } } function getLxcStatus(callback) { -- 2.47.3 _______________________________________________ pve-devel mailing list [email protected] https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
