accetto / ubuntu-vnc-xfce-g3

Headless Ubuntu/Xfce containers with VNC/noVNC (G3v6).
MIT License
214 stars 62 forks source link

Inactive NoVNC session disconnected by network appliance #23

Closed patlachance closed 2 years ago

patlachance commented 2 years ago

As a user of this image behind network appliance (load-balancer, reverse proxy, ...) I should have an option to enable websocket ping/pong In order to avoid being disconnected by the network appliance dropping the inactive TCP session.

Network appliance (load-balancers, reverse proxy) are configured to drop inactive sessions. For example, nginx default configuration is 60 seconds. Same for AWS ELB Classic load balancer, which can be increased up to 3600 seconds.

Websocket provide a configurable ping/pong mechanism to maintain tcp sessions opened on each network hops using heartbeat packet. And there is novnc_proxy parameter to enable it.

accetto commented 2 years ago

@patlachance Thanks for the idea. I'll look at it.

accetto commented 2 years ago

Hello @patlachance

would you please test the new image with the hearbeat? I do not have an appropriate environment at the moment.

You can find the updated image accetto/ubuntu-vnc-xfce-g3:dev-heartbeat on Docker Hub.

I've also published a temporary branch next-release on Git Hub. The CHANGELOG describes the changes. Note that the README files are not completely updated yet.

You should set the new environment variable NOVNC_HEARTBEAT by creating the container, like

docker run -e NOVNC_HEARTBEAT=30 --rm -P accetto/ubuntu-vnc-xfce-g3:dev-heartbeat --debug

If starting with the parameter --debug, then there should be lines similar to these in the output:

Starting noVNC
/usr/libexec/noVNCdim/utils/novnc_proxy --vnc localhost:5901 --listen 6901 --heartbeat 30 &> /dockerstartup/novnc.log
noVNC started on TCP port '6901' with heartbeat 30 seconds

Please let me know, if it really helps. Thanks.

Regards accetto

accetto commented 2 years ago

That's really funny. I've just found, that I've completely missed you PR! So much about doing too many things at once. I'll check your PR now and you can test my changes in a meantime. :)

accetto commented 2 years ago

@patlachance Can you confirm that it's really helping? Have you tested it?

patlachance commented 2 years ago

@accetto sorry for the delay. Yes the image works as expected.