2 TightVNC Java Viewer version 1.3.9
4 ======================================================================
6 This distribution is based on the standard VNC source and includes new
7 TightVNC-specific features and fixes, such as additional low-bandwidth
8 optimizations, major GUI improvements, and more.
10 Copyright (C) 1999 AT&T Laboratories Cambridge.
11 Copyright (C) 2000 Tridia Corp.
12 Copyright (C) 2002-2003 RealVNC Ltd.
13 Copyright (C) 2001-2004 HorizonLive.com, Inc.
14 Copyright (C) 2000-2007 Constantin Kaplinsky
15 Copyright (C) 2000-2007 TightVNC Group
18 This software is distributed under the GNU General Public Licence as
19 published by the Free Software Foundation. See the file LICENCE.TXT for the
20 conditions under which this software is made available. TightVNC also
21 contains code from other sources. See the Acknowledgements section below, and
22 the individual files for details of the conditions under which they are made
26 Compiling from the sources
27 ==========================
29 To compile all the .java files to .class files, simply do:
33 This will also generate a JAR (Java archive) file containing all the classes.
34 Most JVM (Java Virtual Machine) implementations are able to use either a set
35 of .class files, or the JAR archive.
41 There are three basic ways to use TightVNC Java viewer:
43 1. Running applet as part of TightVNC server installation.
45 Both the Unix and Windows versions of TightVNC servers include small
46 built-in HTTP server which can serve Java viewer to Web clients. This
47 enables easy Web access to the shared desktop without need to install
48 any software on the client computer. Unix and Windows versions of
49 TightVNC servers are different in the way they store the .class and .jar
50 files: the Unix server (Xvnc) is able to serve any set of files present
51 in a particular directory, while the Windows server (WinVNC) has all the
52 .class and .jar files inside the WinVNC executable file. Therefore, for
53 Xvnc, it's enough to copy the files into a correct directory, but for
54 WinVNC, the server binaries should be rebuild if the built-in Java
55 viewer should be updated.
57 To install the Java viewer under Xvnc, copy all the .class files, the
58 .jar file and the .vnc files to an installation directory (e.g.
59 /usr/local/vnc/classes):
61 cp *.class *.jar *.vnc /usr/local/vnc/classes
63 Also, make sure that the vncserver script is configured to point to the
64 installation directory (see the Xvnc manual page for the description of
65 the -httpd command-line option).
67 2. Running applet hosted on a standalone Web server.
69 Another possibility to use the Java viewer is to install it under a
70 fully-functional HTTP server such as Apache or IIS. Obviously, this
71 method requires running an HTTP server, and due to the Java security
72 restrictions, it's also required that the server should be installed on
73 the same machine which is running the TightVNC server. In this case,
74 installation is simply copying the .class and .jar files into a
75 directory that is under control of the HTTP server. Also, an HTML page
76 should be created which will act as a the base document for the viewer
77 applet (see an example named index.html in this distribution).
79 NOTE: Provided index.html page is an example only. Before using that
80 file, edit it with a text editor. See more information inside
83 3. Running the viewer as a standalone application.
85 Finally, the Java viewer can be executed locally on the client machine,
86 but this method requires installation of either JRE (Java Runtime
87 Environment) or JDK (Java Development Kit). If all the .class files are
88 in the current directory, the Java viewer can be executed like this,
89 from the command line:
91 java VncViewer HOST vnchost PORT 5900
93 The parameters HOST and PORT are required, but there is a number of
94 optional parameters as well (see the Parameters section below).
99 TightVNC Java viewer supports a number of parameters allowing you to
100 customize its behavior. Most parameters directly correspond to the settings
101 found in the Options window. However, there are parameters that do not
102 correspond to those settings. For such parameters, you can see a note "no GUI
103 equivalent", in the documentation below.
105 Parameters can be specified in one of the two ways, depending on how the Java
108 1. When the Java viewer is run as an applet (embedded within an HTML
109 document), parameters should be specified in the <PARAM> HTML tags,
110 within the appropriate <APPLET> section. Here is an example:
112 <APPLET CODE=VncViewer.class ARCHIVE=VncViewer.jar WIDTH=400 HEIGHT=300>
113 <PARAM NAME="PORT" VALUE=5901>
114 <PARAM NAME="Scaling factor" VALUE=50>
117 2. When run as a standalone application, the Java viewer reads parameters
118 from the command line. Command-line arguments should be specified in
119 pairs -- first goes parameter name, then parameter value. Here is a
120 command line example:
122 java VncViewer HOST vnchost PORT 5901 "Scaling factor" 50
124 Both parameter names and their values are case-insensitive. The only
125 exception is the "PASSWORD" parameter, as VNC passwords are case-sensitive.
127 Here is the complete list of parameters supported in TightVNC Java viewer:
129 --> "HOST" (no GUI equivalent)
131 Value: host name or IP address of the VNC server.
132 Default: in applet mode, the host from which the applet was loaded.
134 This parameter tells the viewer which server to connect to. It's not
135 needed in the applet mode, because default Java security policy allow
136 connections from applets to the only one host anyway, and that is the
137 host from which the applet was loaded. However, this parameter is
138 required if the viewer is used as a standalone application.
140 --> "PORT" (no GUI equivalent)
142 Value: TCP port number on the VNC server.
145 This parameter is required in all cases. Note that this port is not the
146 one used for HTTP connection from the browser, it is the port used for
147 RFB connection. Usually, VNC servers use ports 58xx for HTTP connections,
148 and ports 59xx for RFB connections. Thus, most likely, this parameter
149 should be set to something like 5900, 5901 etc.
153 Value: session password in plain text.
154 Default: none, ask user.
156 DO NOT EVER USE THIS PARAMETER, unless you really know what you are
157 doing. It's extremely dangerous from the security point of view. When
158 this parameter is set, the viewer won't ever ask for a password.
162 Value: encrypted session password in hex-ascii.
163 Default: none, ask user.
165 The same as the "PASSWORD" parameter but DES-encrypted using a fixed key.
166 Its value should be represented in hex-ascii e.g. "494015f9a35e8b22".
167 This parameter has higher priority over the "PASSWORD" parameter. DO NOT
168 EVER USE THIS PARAMETER, unless you really know what you are doing. It's
169 extremely dangerous from the security point of view, and encryption does
170 not actually help here since the decryption key is always known.
174 Values: "Auto", "Raw", "RRE", "CoRRE", "Hextile", "ZRLE", "Zlib", "Tight".
177 The preferred encoding. If the value is "Auto", then the viewer will
178 continuously estimate average network throughput and request encodings
179 that are appropriate for current connection speed. "Hextile" is an
180 encoding that was designed for fast networks, while "Tight" is better
181 suited for low-bandwidth connections. From the other side, "Tight"
182 decoder in the TightVNC Java viewer seems to be more efficient than
183 "Hextile" decoder so it may be ok for fast networks too. "ZRLE" encoding
184 is similar to "Tight", but it does not support JPEG compression and
185 compression levels. Unlike "Tight" encoding, "ZRLE" is supported in
186 recent versions of RealVNC products. Other encodings are not efficient
187 and provided for compatibility reasons.
189 --> "Compression level"
191 Values: "Default", "1", "2", "3", "4", "5", "6", "7", "8", "9".
192 Default: "Default". ;-)
194 Use specified compression level for "Tight" and "Zlib" encodings. Level 1
195 uses minimum of CPU time on the server but achieves weak compression
196 ratios. Level 9 offers best compression but may be slow in terms of CPU
197 time consumption on the server side. Use high levels with very slow
198 network connections, and low levels when working over higher-speed
199 networks. The "Default" value means that the server's default compression
200 level should be used.
202 --> "JPEG image quality"
204 Values: "JPEG off", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9".
207 Use the specified image quality level in "Tight" encoding. Quality level
208 0 denotes bad image quality but very impressive compression ratios, while
209 level 9 offers very good image quality at lower compression ratios. If
210 the value is "JPEG off", the server will not use lossy JPEG compression
213 --> "Cursor shape updates"
215 Values: "Enable", "Ignore", "Disable".
218 Cursor shape updates is a protocol extension used to handle remote cursor
219 movements locally on the client side, saving bandwidth and eliminating
220 delays in mouse pointer movement. Note that current implementation of
221 cursor shape updates does not allow a client to track mouse cursor
222 position at the server side. This means that clients would not see mouse
223 cursor movements if mouse was moved either locally on the server, or by
224 another remote VNC client. Set this parameter to "Disable" if you always
225 want to see real cursor position on the remote side. Setting this option
226 to "Ignore" is similar to "Enable" but the remote cursor will not be
227 visible at all. This can be a reasonable setting if you don't care about
228 cursor shape and don't want to see two mouse cursors, one above another.
235 The "CopyRect" encoding saves bandwidth and drawing time when parts of
236 the remote screen are moving around. Most likely, you don't want to
239 --> "Restricted colors"
244 If set to "No", then 24-bit color format is used to represent pixel data.
245 If set to "Yes", then only 8 bits are used to represent each pixel. 8-bit
246 color format can save bandwidth, but colors may look very inaccurate.
248 --> "Mouse buttons 2 and 3"
250 Values: "Normal", "Reversed".
253 If set to "Reversed", then right mouse button (button 2) will act as it
254 was middle mouse button (button 3), and vice versa.
261 If set to "Yes", then all keyboard and mouse events in the desktop window
262 will be silently ignored and will not be passed to the remote side.
264 --> "Scale remote cursor"
266 Values: "No", "50%", "75%", "125%", "150%".
269 If a percentage value is specified, the remote cursor is reduced
270 or enlarged accordingly. Scaling takes place only when "View only"
271 is set to "No", and "Cursor shape updates" is set to "Enable".
278 Share the connection with other clients on the same VNC server. The exact
279 behaviour in each case depends on the server configuration.
281 --> "Open new window" (no GUI equivalent, applicable only in the applet mode)
286 Operate in a separate window. This makes possible resizing the desktop,
287 and adds scroll bars when necessary. If the server supports variable
288 desktop size, the window will resize automatically when remote desktop
291 --> "Scaling factor" (no GUI equivalent)
293 Value: an integer in the range of [1..1000], or the string "auto".
296 Scale local representation of the remote desktop. The value is
297 interpreted as scaling factor in percents. The default value of 100%
298 corresponds to the original framebuffer size. Values below 100 reduce
299 image size, values above 100 enlarge the image proportionally. If the
300 parameter is set to "auto", automatic scaling is performed. Auto-scaling
301 tries to choose scaling factor such way that the whole remote framebuffer
302 will fit on the local screen. Currently, auto-scaling is supported only
303 when the remote desktop is shown in a separate frame (always true in the
304 application mode, and also in the applet mode with "Open new window"
305 parameter set to "yes").
307 --> "Show controls" (no GUI equivalent)
312 Set to "No" if you want to get rid of that button panel at the top.
314 --> "Offer relogin" (no GUI equivalent, not applicable in the applet mode)
319 If set to "No", the buttons "Login again" and "Close window" won't be
320 shown on disconnects or after an error has occured.
322 --> "Show offline desktop" (no GUI equivalent)
327 If set to "Yes", the viewer would continue to display desktop even
328 if the remote side has closed the connection. In this case, if the
329 button panel is enabled, then the "Disconnect" button would be
330 changed to "Hide desktop" after the connection is lost.
332 --> "Defer screen updates" (no GUI equivalent)
334 Value: time in milliseconds.
337 When updating the desktop contents after receiving an update from server,
338 schedule repaint within the specified number of milliseconds. Small delay
339 helps to coalesce several small updates into one drawing operation,
340 improving CPU usage. Set this parameter to 0 to disable deferred updates.
342 --> "Defer cursor updates" (no GUI equivalent)
344 Value: time in milliseconds.
347 When updating the desktop after moving the mouse, schedule repaint within
348 the specified number of milliseconds. This setting makes sense only when
349 "Cursor shape updates" parameter is set to "Enable". Small delay helps to
350 coalesce several small updates into one drawing operation, improving CPU
351 usage. Set this parameter to 0 to disable deferred cursor updates.
353 --> "Defer update requests" (no GUI equivalent)
355 Value: time in milliseconds.
358 After processing an update received from server, wait for the specified
359 number of milliseconds before requesting next screen update. Such delay
360 will end immediately on every mouse or keyboard event if not in the "view
361 only" mode. Small delay helps the server to coalesce several small
362 updates into one framebuffer update, improving both bandwidth and CPU
363 usage. Increasing the parameter value does not affect responsiveness on
364 mouse and keyboard events, but causes delays in updating the screen when
365 there is no mouse and keyboard activity on the client side.
367 --> "SocketFactory" (no GUI equivalent)
369 Value: name of the class.
372 This option provides the way to define an alternate I/O implementation.
373 The dynamically referenced class must implement a SocketFactory
374 interface, and create a Socket, as configured by this parameter. See the
375 source in SocketFactory.java.
378 RECORDING VNC SESSIONS
379 ======================
381 Current version of the TightVNC Java viewer is able to record VNC (RFB)
382 sessions in files for later playback. The data format in saved session files
383 is compatible with the rfbproxy program written by Tim Waugh. Most important
384 thing about session recording is that it's supported only if Java security
385 manager allows access to local filesystem. Typically, it would not work for
386 unsigned applets. To use this feature, either use TightVNC Java viewer as a
387 standalone application (Java Runtime Environment or Java Development Kit
388 should be installed), or as a signed applet. The code checks if it's possible
389 to support session recording, and if everything's fine, the new "Record"
390 button should appear in the button panel. Pressing this button opens new
391 window which controls session recording. The GUI is pretty self-explained.
393 Other important facts about session recording:
395 --> All sessions are recorded in the 24-bit color format. If you use
396 restricted colors (8-bit format), it will be temporarly switched to
397 24-bit mode during session recording.
399 --> All sessions are recorded with cursor shape updates turned off. This is
400 necessary to represent remote cursor movements in recorded sessions.
402 --> Closing and re-opening the recording control window does not affect the
403 recording. It's not necessary to keep that window open during recording a
406 --> Avoid using Zlib and ZRLE encodings when recording sessions. If you have
407 started recording BEFORE opening a VNC session, then you are ok. But
408 otherwise, all Zlib-encoded updates will be saved Raw-encoded (that is,
409 without compression at all). The case with ZRLE is even worse -- ZRLE
410 updates will not be saved at all, so the resulting session file may be
411 corrupted. Zlib decoding depends on the pixel data received earlier, thus
412 saving the data received from the server at an arbitrary moment is not
413 sufficient to decompress it correctly. And there is no way to tell Zlib
414 or ZRLE decoder to reset decompressor's state -- that's a limitation of
415 these encoders. The viewer could re-compress raw pixel data again before
416 saving Zlib-encoded sessions, but unfortunately Java API does not allow
417 to flush zlib data streams making it impossible to save Zlib-encoded RFB
418 pixel data without using native code.
420 --> Usually, Tight encoding is the most suitable one for session recording,
421 but some of the issues described above for the Zlib encoding affect the
422 Tight encoding as well. Unlike Zlib sessions, Tight-encoded sessions are
423 always saved Tight-encoded, but the viewer has to re-compress parts of
424 data to synchronize encoder's and decoder's zlib streams. And, due to
425 Java zlib API limitations, zlib streams' states have to be reset on each
426 compressed rectangle, causing compression ratios to be lower than in the
427 original VNC session. If you want to achieve the best possible
428 performance, turn recording on BEFORE connecting to the VNC server,
429 otherwise CPU usage and compression ratios may be notably less efficient.
435 --> To refresh remote desktop in the view-only mode, press "r" or "R"
442 This distribution contains Java DES software by Dave Zimmerman
443 <dzimm@widget.com> and Jef Poskanzer <jef@acme.com>. This is:
445 Copyright (c) 1996 Widget Workshop, Inc. All Rights Reserved.
447 Permission to use, copy, modify, and distribute this software and its
448 documentation for NON-COMMERCIAL or COMMERCIAL purposes and without fee
449 is hereby granted, provided that this copyright notice is kept intact.
451 WIDGET WORKSHOP MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
452 SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT
453 NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
454 PARTICULAR PURPOSE, OR NON-INFRINGEMENT. WIDGET WORKSHOP SHALL NOT BE
455 LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING,
456 MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
458 THIS SOFTWARE IS NOT DESIGNED OR INTENDED FOR USE OR RESALE AS ON-LINE
459 CONTROL EQUIPMENT IN HAZARDOUS ENVIRONMENTS REQUIRING FAIL-SAFE
460 PERFORMANCE, SUCH AS IN THE OPERATION OF NUCLEAR FACILITIES, AIRCRAFT
461 NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL, DIRECT LIFE
462 SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH THE FAILURE OF THE
463 SOFTWARE COULD LEAD DIRECTLY TO DEATH, PERSONAL INJURY, OR SEVERE
464 PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH RISK ACTIVITIES"). WIDGET
465 WORKSHOP SPECIFICALLY DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY OF
466 FITNESS FOR HIGH RISK ACTIVITIES.
468 Copyright (C) 1996 by Jef Poskanzer <jef@acme.com>. All rights
471 Redistribution and use in source and binary forms, with or without
472 modification, are permitted provided that the following conditions
474 1. Redistributions of source code must retain the above copyright
475 notice, this list of conditions and the following disclaimer.
476 2. Redistributions in binary form must reproduce the above copyright
477 notice, this list of conditions and the following disclaimer in the
478 documentation and/or other materials provided with the distribution.
480 THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
481 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
482 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
483 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
484 BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
485 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
486 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
487 BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
488 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
489 OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
490 ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
492 Visit the ACME Labs Java page for up-to-date versions of this and other
493 fine Java utilities: http://www.acme.com/java/