-
Notifications
You must be signed in to change notification settings - Fork 0
Integration
noVNC is designed to be easily integrated into existing web sites with the existing structure and styling. For details about the modules that make up noVNC and their Javascript API see the ModulesAPI page.
-
All files necessary for integrating noVNC are in the
include/
subdirectory of the project. -
The file
vnc.js
will dynamically included all other files required for basic noVNC functionality. The global variableINCLUDE_URI
is used byvnc.js
as the URL prefix for the other noVNC files. The value ofINCLUDE_URI
defaults toinclude/
. -
The file
ui.js
has a load() routine UI that will generate a basic noVNC UI and provide default callback handlers. -
The file
plain.css
provides some very simple styling that is compatible with the UI generated byui.js
. The fileblack.css
provides an alternate styling. -
The simplest way to create a noVNC page is with
vnc.js
,ui.js
andplain.css
and then callingUI.load()
. For example:<head> <script src='include/vnc.js'></script> <script src="include/ui.js"></script> <link rel="stylesheet" href="include/plain.css"> </head> <body> <div id='vnc'>Loading</div> <script> window.onload = function () { UI.load('vnc'); }; </script> </body>
-
See
vnc.html
for a fleshed out working example of the above. -
The file
vnc_auto.html
is a working example that does not useui.js
. It statically defines the UI and provides callback functions all on one page.vnc_auto.html
takes host, port and password settings from the URL query string and automatically connects as soon as the page loads.
When noVNC is disconnected, the canvas area displays a logo. This logo
is a Data URI scheme image encoded in the logo.js
file.
To generate a new logo from an existing image file, run the following
command replacing /path/to/IMAGE
with the path to the image you wish
to use (in PNG, JPEG, or GIF format):
./utils/img2js.py /path/to/IMAGE noVNC_logo > include/logo.js
The image should be at least 640 pixels wide to allow for space in the status bar above the canvas area for messages.