]> git.proxmox.com Git - mirror_novnc.git/blame - README.md
README.md: add link to browsers.md, update requirements.
[mirror_novnc.git] / README.md
CommitLineData
5ba1dd78 1## noVNC: HTML5 VNC Client
5aeb9880
JM
2
3
5ba1dd78 4### Description
5aeb9880 5
71d2426a 6noVNC is a VNC client implemented using HTML5 technologies,
b89c6db3 7specifically Canvas and WebSockets (supports 'wss://' encryption).
5f409eee
JM
8noVNC is licensed under the
9[LGPLv3](http://www.gnu.org/licenses/lgpl.html).
5aeb9880 10
77c7a454
JM
11Special thanks to [Sentry Data Systems](http://www.sentryds.com) for
12sponsoring ongoing development of this project (and for employing me).
852ba642 13
b4748f04
JM
14Notable commits, announcements and news are posted to
15@<a href="http://www.twitter.com/noVNC">noVNC</a>
16
17
852ba642
JM
18### Screenshots
19
e5517ecd 20Running in Chrome before and after connecting:
600887f0 21
e5517ecd 22<img src="http://kanaka.github.com/noVNC/img/noVNC-1.jpg" width=400>&nbsp;<img src="http://kanaka.github.com/noVNC/img/noVNC-2.jpg" width=400>
5aeb9880 23
852ba642
JM
24See more screenshots <a href="http://kanaka.github.com/noVNC/screenshots.html">here</a>.
25
26
6de07adb
JM
27### Browser Requirements
28
29<a href="http://github.com/kanaka/noVNC/blob/master/docs/browsers.md">
30Detailed browser status/testing</a>.
31
32* HTML5 Canvas: Except for Internet Explorer, most
33 browsers have had Canvas support for quite some time. Internet
34 Explorer 9 will have Canvas support (finally).
35
36* HTML5 WebSockets: For browsers that do not have builtin
37 WebSockets support, the project includes
38 <a href="http://github.com/gimite/web-socket-js">web-socket-js</a>,
39 a WebSockets emulator using Adobe Flash.
40
41* Fast Javascript Engine: noVNC avoids using new Javascript
42 functionality so it will run on older browsers, but decode and
43 rendering happen in Javascript, so a slow Javascript engine will
44 mean noVNC is painfully slow.
45
46### Server Requirements
5aeb9880 47
b89c6db3
JM
48Unless you are using a VNC server with support for WebSockets
49connections (only my [fork of libvncserver](http://github.com/kanaka/libvncserver)
50currently), you need to use a WebSockets to TCP socket proxy. There is
51a python proxy included ('wsproxy'). One advantage of using the proxy
52is that it has builtin support for SSL/TLS encryption (i.e. "wss://").
5aeb9880 53
1626e0f8 54There a few reasons why a proxy is required:
5aeb9880 55
b89c6db3 56 1. WebSockets is not a pure socket protocol. There is an initial HTTP
1626e0f8 57 like handshake to allow easy hand-off by web servers and allow
b89c6db3 58 some origin policy exchange. Also, each WebSockets frame begins
1626e0f8 59 with 0 ('\x00') and ends with 255 ('\xff').
d63e1462
JM
60
61 2. Javascript itself does not have the ability to handle pure byte
3b6f60be
JM
62 arrays. The python proxy encodes the data as base64 so that the
63 Javascript client can decode the data as an integer array.
1626e0f8 64
5aeb9880 65
b89c6db3 66### Quick Start
5aeb9880 67
b89c6db3
JM
68* Use the launch script to start a mini-webserver and the WebSockets
69 proxy. The `--vnc` option is used to specify the location of
70 a running VNC server:
71
72 `./utils/launch.sh --vnc localhost:5901`
73
74* Point your browser to the cut-and-paste URL that is output by the
75 launch script. Enter a password if the VNC server has one
76 configured. Hit the Connect button and enjoy!
77
78
79### Advanced usage
5aeb9880 80
a4807656 81* To encrypt the traffic using the WebSocket 'wss://' URI scheme you
b89c6db3 82 need to generate a certificate for the proxy to load. By default the
3b6f60be
JM
83 proxy loads a certificate file name `self.pem` but the `--cert=CERT`
84 option can override the file name. You can generate a self-signed
85 certificate using openssl. When asked for the common name, use the
86 hostname of the server where the proxy will be running:
a4807656
JM
87
88 `openssl req -new -x509 -days 365 -nodes -out self.pem -keyout self.pem`
89
b89c6db3
JM
90* `tightvnc` provide a nice startup script that can be used to run
91 a separate X desktop that is served by VNC. To install and run the
92 server under Ubuntu you would do something like this:
93
94 `sudo apt-get install tightvncserver`
0af07711 95
1626e0f8 96 `vncserver :1`
5aeb9880 97
b89c6db3
JM
98 The VNC server will run in the background. The port that it runs
99 on is the display number + 5900 (i.e. 5901 in the case above).
100
101* `x11vnc` can be used to share your current X desktop. Note that if
102 you run noVNC on the X desktop you are connecting to via VNC you
103 will get a neat hall of mirrors effect, but the the client and
104 server will fight over the mouse.
105
106 `sudo apt-get install x11vnc`
0af07711 107
b89c6db3
JM
108 `x11vnc -forever -display :0`
109
110 Without the `-forever` option, x11vnc will exit after the first
111 disconnect. The `-display` option indicates the exiting X display to
112 share. The port that it runs on is the display number + 5900 (i.e.
113 5900 in the case above).
114
115* To run the python proxy directly without using launch script (to
116 pass additional options for example):
5aeb9880 117
3b6f60be 118 `./utils/wsproxy.py -f source_port target_addr:target_port`
5aeb9880 119
14607116 120 `./utils/wsproxy.py -f 8787 localhost:5901`
5aeb9880 121
b89c6db3 122* To run the mini python web server without the launch script:
5aeb9880 123
7210e79e 124 `./utils/web.py PORT`
5aeb9880 125
7210e79e 126 `./utils/web.py 8080`
5aeb9880
JM
127
128* Point your web browser at http://localhost:8080/vnc.html
3b6f60be
JM
129 (or whatever port you used above to run the web server). Specify the
130 host and port where the proxy is running and the password that the
131 vnc server is using (if any). Hit the Connect button.
5aeb9880 132
ded9dfae 133
5ba1dd78 134### Integration
ded9dfae
JM
135
136The client is designed to be easily integrated with existing web
137structure and style.
138
4f0da9ef 139At a minimum you must include the `vnc.js` and `default_controls.js`
8db09746 140scripts and call DefaultControls.load(). For example:
ded9dfae 141
a93c9555
JM
142 <head>
143 <script src='include/vnc.js'></script>
144 <script src="include/default_controls.js"></script>
145 </head>
ded9dfae
JM
146 <body>
147 <div id='vnc'>Loading</div>
8db09746
JM
148
149 <script>
150 window.onload = function () {
151 DefaultControls.load('vnc');
152 }
153 </script>
ded9dfae 154 </body>
ded9dfae 155
4f0da9ef
JM
156See `vnc.html` and `vnc_auto.html` for examples. The file
157`include/plain.css` has a list of stylable elements.
1aa95062
JM
158
159The `vnc.js` also includes other scripts within the `include`
160sub-directory. The `VNC_uri_prefix` variable can be use override the
acad10a5 161URL path to the `include` sub-directory.
a095b382
JM
162
163
164### Troubleshooting
165
166You will need console logging support in the browser. Recent Chrome
167and Opera versions have built in support. Firefox has a nice extension
168called "firebug" that gives console logging support.
169
170First, load the noVNC page with `logging=debug` added to the query string.
171For example `vnc.html?logging=debug`.
172
173Then, activate the console logger in your browser. With Chrome it can
174be activate using Ctrl+Shift+J and then switching to the "Console"
175tab. With firefox+firebug, it can be activated using Ctrl+F12.
176
177Now reproduce the problem. The console log output will give more
178information about what is going wrong and where in the code the
11304584
JM
179problem is located.
180
181If you file a issue/bug, it is very helpful for me to have the last
182page of console output leading up the problem in the issue report.
183Other helpful issue/bug information: browser version, OS version,
184noVNC git version, and VNC server name/version.