Hi,
I have followed https://forum.proxmox.com/threads/how-to-set-up-novnc-on-a-web-application.123701/ to implement noVNC console some time ago. Everything is working but:
1) in PVE I have noticed two same /vncproxy calls where the first one has connection timeout and second is connected,
2) I realized I do not need /vncwebsocket call to load noVNC in iframe
3) no matter if I use $ticket from login or ticket from vncproxy call, it works for both situations
Check comments in code:
Can someone explain why it behaves like that and what steps are really required for noVNC in iframe?
I have followed https://forum.proxmox.com/threads/how-to-set-up-novnc-on-a-web-application.123701/ to implement noVNC console some time ago. Everything is working but:
1) in PVE I have noticed two same /vncproxy calls where the first one has connection timeout and second is connected,
2) I realized I do not need /vncwebsocket call to load noVNC in iframe
3) no matter if I use $ticket from login or ticket from vncproxy call, it works for both situations
Check comments in code:
PHP:
// ad 1) this is 2x in PVE proxy, first connection timeout (maybe due to being killed by second call)
$config = $proxmox->create("/nodes/$node/qemu/$vmid/vncproxy", [
'websocket' => 1, // Start websocket proxy
]);
// ad 2) I can comment this out and nothing will be broken because i can use $config['data']['ticket'] and $config['data']['port'] in iframe link directly to make it work
$websock = $proxmox->get("/nodes/$node/qemu/$vmid/vncwebsocket", [
'vncticket' => $config['data']['ticket'],
'port' => $config['data']['port']
]);
// ad 3) here I am using $config['data']['ticket'] instead of $ticket of login
$src_href = 'https://'.$host.':8006/?console=kvm&novnc=1&node='.$node.'&resize=1&vmid='.$vmid.'&path=api2/json/nodes/'.$node.'/qemu/'.$vmid.'/vncwebsocket/port/'.$config['data']['port'].'"/vncticket/"'.$ticket;
echo '<iframe src="'.$src_href.'" frameborder="0" scrolling="no" width="100%" height="100%"></iframe>';
Can someone explain why it behaves like that and what steps are really required for noVNC in iframe?
Last edited: