【发布时间】:2014-12-31 13:31:31
【问题描述】:
我试图弄清楚如何让 noVNC 通过反向代理工作,虽然如果我直接连接到它可以工作,但如果我尝试反向代理它似乎不起作用。
即:
我以./utils/launch.sh --vnc localhost:5901 运行它
如果我以https://<machine>:6080/vnc.html?host=<machine>&port=6080 连接到它
它工作正常,我可以连接到 vnc 会话
但是,我希望能够通过端口 443 上的反向代理连接到它。
在 Apache 2.4.10(Debian Jessie 中的 -8)中,我已将代理行配置为
ProxyPass /home http://127.0.0.1:6080/
ProxyPassReverse /home http://127.0.0.1:6080/
ProxyPass /websockify wss://127.0.0.1:6080/websockify retry=3
ProxyPassReverse /websockify wss://127.0.0.1:6080/websockify retry=3
我以https://<machine>/vnc.html?host=<machine>&port=6080 连接到它
这仍然有效,因为当 html/javascript 的获取通过反向代理进行时,我仍然告诉 websocket 连接超过 6080 并且它有效。
但是,当我将其更改为 https://<machine>/vnc.html?host=<machine>&port=443
我得到 html/javascript 就好了,但是当它建立连接时,在 firefox(以及 chrome 和 IE,但这个错误是特定于 firefox)我很快得到
Firefox can't establish a connection to the server at wss://<machine>/websockify.
在 noVNC 中我看到了错误消息
127.0.0.1: ignoring socket not ready
【问题讨论】:
-
这个动机的很大一部分是让我能够在“跳转主机”上保持一个 ssh 端口转发会话,并且 noVNC 只在 localhost 上监听,这样我就可以密码保护访问它。当我只能通过 443 访问它时,它甚至可以在受限环境中工作。
标签: apache google-chrome firefox websocket vnc