Hello everybody,
I wanted to share how I was able to setup noVNC with Xvnc (from TightVNC) and lighttpd on a project I'm maintaining. Great job on noVNC, absolutely loved it. I am very far from an expert on these matters, but I hope my little experience here can help other newbies out there that are too afraid to ask.
First I was able to get noVNC working by running websockify as a daemon to proxy from Xvnc's 5901 TCP socket to a websocket on 5902. This worked fine and I was happy about it... until I realized I could get more and avoid the need of having the 5902 port open and could tunnel everything through TCP 80 port. The Python sample with websockify points towards that direction with its simple web-server, but I don't have room for Python in the device.
So I gave a try to
lighttpd with
mod_websocket plugin. First attempt with websockify running in the background worked fine as well, but when I tried to use mod_websocket's TCP proxy I had to add the "binary" string to the "subproto" for everything to work through the same port. Details are at the end.
Also, I wanted to mention that I had to go to back to lighttpd-1.4.33 in order to mod_websocket to build properly since it doesn't seem to be up to date.
Thanks again. Best regards!
Sebastián.-
The URL I now pass to noVNC is url='ws://<host>/tcp_proxy'
And the lighttpd.conf looks like:
server.modules += ( "mod_proxy", "mod_websocket" )
server.document-root = "/usr/local/zigor/activa/www/html"
server.port = 80
mimetype.assign = (
".html" => "text/html",
".css" => "text/css",
".txt" => "text/plain",
".jpg" => "image/jpeg",
".png" => "image/png",
".js" => "text/javascript"
)
index-file.names = ( "index.html" )
websocket.server = (
# WebSocket-TCP Proxy, this connects directly to Xvnc
"^\/tcp_proxy\/*" => ( "host" => "localhost",
"port" => 5901,
"proto" => "tcp",
"type" => "binary",
"subproto" => "binary",
),
# This requires websockify to be in the middle forwarding Xvnc 5901 to 5902
"^\/websocket\/*" => ( "host" => "localhost",
"port" => 5902,
"type" => "binary",
"proto" => "websocket",
),
)
websocket.ping_interval = 5 # send PING per 5 secs
websocket.timeout = 30 # disconnect a client when not to recv PONG for 30 secs
websocket.debug = 4 # LOG_DEBUG