返回列表 发帖

[技术文章] noVNC在Windows下的安装配置

一、实现功能

目标:通过浏览器远程访问Windows桌面。

原理:浏览器不支持VNC,所以不能直接连接VNC,但是可以使用代理,使用noVNC通过WebSocket建立连接,而VNC Server不支持WebSocket,所以需要开启Websockify代理来做WebSocketTCP Socket之间的转换。



二、准备工作

1、测试环境:Windows 7

2、UltraVNC:http://www.uvnc.com/(Windows环境下的VNC Server,当然还有TightVNC,RealVNC,我也试了下这两个,好像不能通过noVNC)

3、Node.js:https://nodejs.org/en/download/(用于执行Websockify.js。Websockify还有Python版本的,不过在Windows下没有成功)

4、noVNC:http://github.com/kanaka/noVNC/zipball/master

5、Wesockify:https://github.com/novnc/websockify/archive/master.zip

三、具体操作

1、安装UltraVNC Server 并开启服务(安装后设置密码)



2、安装Node.js

           安装时选择npm package manager

   

   安装ws、optimist模块(执行websockify.js文件所需)

C:\Users\Administrator>npm install ws

npm WARN saveError ENOENT: no such file or directory, open 'C:\Users\Administrat

or\package.json'

npm notice created a lockfile as package-lock.json. You should commit this file.


npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\Administrator\

package.json'

npm WARN Administrator No description

npm WARN Administrator No repository field.

npm WARN Administrator No README data

npm WARN Administrator No license field.


+ ws@5.1.0

added 2 packages in 1.836s


C:\Users\Administrator>npm install optimist

npm WARN saveError ENOENT: no such file or directory, open 'C:\Users\Administrat

or\package.json'

npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\Administrator\

package.json'

npm WARN Administrator No description

npm WARN Administrator No repository field.

npm WARN Administrator No README data

npm WARN Administrator No license field.


+ optimist@0.6.1

added 3 packages in 36.53s




C:\Users\Administrator

npm WARN saveError ENOENT: no such file >npm install mime-types --saveor directory, open 'C:\Users\Administrat

or\package.json'

npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\Administrator\

package.json'

npm WARN Administrator No description

npm WARN Administrator No repository field.

npm WARN Administrator No README data

npm WARN Administrator No license field.


+ mime-types@2.1.18

updated 1 package in 1.506s


      

     


安装完ws和optimist后会在C:\Users\Administrator\下生成node_modules目录



3、把noVNC.zip解压到node_modules目录下,再把websockify-master.zi目录下。



4、执行websockify.js:转发9000端口的http链接到5900端口(UltraVNC Server的默认端口为5900



5、在浏览器地址栏输入http://192.168.1.163:9000/(服务器端IP192.168.1.163

会是这样



这时候只要把websockify.js的102行改成filename += /vnc.html;



再重复第4、5步 点击Connect输入UltraVNC设置的密码 完成。

欢迎光临:逐梦论坛

返回列表

Powered by Discuz! 7.2   论坛QQ群:逐梦论坛群

© 2001-2021 Comsenz Inc. 本站服务器由0634云主机提供 鲁公网安备 37120302000001号