1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-12-02 00:46:05 +00:00

fix(console): a VNC console stays open while its screen does not change

nginx ends a proxied websocket that sends nothing for 60 seconds, and the
VNC console sends nothing while the VM's screen stays the same: an idle
console, an installer's progress screen, closed after a minute and had to
be connected again. novncd now pings the browser every 30 seconds. The SSH
tunnel of an SSH compute sends a keepalive as often, for a firewall on the
way that ends idle connections.
This commit is contained in:
catborise 2026-11-01 14:57:50 +03:00
parent 005fa59bf0
commit 0cd687e035
3 changed files with 7 additions and 2 deletions

View file

@ -51,7 +51,9 @@ def open_tunnel(host, user, target):
"""A socket connected to target on host, and the Tunnel carrying it.
ssh never asks for anything: a missing key or an unknown host key fails."""
ours, theirs = socket.socketpair()
argv = ["ssh", "-o", "BatchMode=yes", "-o", "ConnectTimeout=10", "-W", target]
# ServerAliveInterval: a console whose screen stays the same sends nothing,
# and a firewall on the way may end an idle connection
argv = ["ssh", "-o", "BatchMode=yes", "-o", "ConnectTimeout=10", "-o", "ServerAliveInterval=30", "-W", target]
if user:
argv += ["-l", user]
tunnel = Tunnel(argv + ["--", host], theirs)