Commit Graph

129 Commits

Author SHA1 Message Date
Julien Fontanet 58ca1978ea Fix subprotocols
Broken by b1dee94788
2014-10-01 16:30:39 +02:00
Solly Ross d02a99f0c8 Fixed Typo Causing MouseUp to not Register
There was a typo in one of the instances of the _buttonMask field
(it was written as _buttonMaks), causing MouseUp to never be sent.
This has been rectified, and the unit tests for the mouse handler
have been changed to check for explicitly sending mouseup and
mousedown.

Fixes #393
2014-09-19 14:18:45 -04:00
Solly Ross b1dee94788 Cleanup: RFB Client
File: rfb.js (also websock.js)
Tests Added: True

Changes:
- De-Crockford-ified rfb.js
- Added methods to websock.js to skip bytes in the receive queue
2014-09-15 16:46:02 -04:00
Solly Ross 95eb681bbb Support the "NOTUNNEL" tunnel type for TightVNC
Previously, tight auth was supported without any support for tunnels,
even the no-op tunnel.  No, the no-op tunnel type is supported.
2014-09-15 16:46:02 -04:00
Solly 7cad15425e Merge pull request #347 from dol/fix/better-ws-binarytype-detection
Improved websocket binary support detection
2014-03-26 10:58:11 -04:00
samhed b7996b048b Added a wrapper for the UTF-8 decoding. 2014-03-14 15:18:05 +01:00
samhed 6227a91c01 Decode from UTF-8 to allow unicode characters in the connection name 2014-03-14 13:44:10 +01:00
Dominic Luechinger 97362c3980 Improved websocket binary support detection
A facke connection to 'wss://localhost:17523' (randomly chosen) to detect
the WebSocket binary support is not the best solution.
First of all, check of prototype has the property 'binaryType'. If not,
perform a dummy connection to 'wss://.' instead of 'wss://localhost:17523'.

This patch was inspired by the discussion and implementation of Modernizr:
https://github.com/Modernizr/Modernizr/issues/370
https://github.com/Modernizr/Modernizr/blob/master/feature-detects/websockets/binary.js
2014-03-11 14:29:58 +01:00
Julien Fontanet c7fc3c082f WebSocket protocols are now configurable. 2014-02-19 19:29:06 +01:00
Malcolm Scott a856a051da Implement XVP extension (shutdown/reboot/reset) 2014-02-17 17:55:28 -05:00
Malcolm Scott 03ab251587 Implement XVP auth 2014-02-17 17:55:28 -05:00
Solly df6b7d7341 Merge pull request #327 from devicenull/master
Add support for connecting to TightVNC servers
2014-02-10 17:21:29 -05:00
samhed 20074a49eb Removes the connection timeouts to enable slower clients, connections or servers. 2014-02-06 16:08:00 +01:00
Brian Rak d86cc2d911 Add support for TightVNC auth type 2014-01-30 19:20:41 -05:00
jalf fa30469cda Keyboard Handling [5/8]: Update rfb.js to connect mouse events to keyboard handler
This allows the keyboard handler to check modifier key state much more frequently

Since some browsers never send keyup events for modifier keys, we have to
synchronize modifier state whenever we get a mouse or keyboard event
2013-12-05 12:25:31 -05:00
Samuel 69127447ac Merge pull request #282 from samhed/framebufferupdate
Allow higher frame rates by using a new approach for framebufferUpdate requests
2013-10-10 02:45:08 -07:00
samhed 76e262134e * Removed fbu-requests from the places I missed earlier.
* Added a few clarifying comments.
2013-08-29 13:38:12 +02:00
Anton Lundin c39df031d8 clearTimeout instead of clearInterval for timers
We create timeouts, not intervals. Then we need to clear them with
clearTimeout.
2013-08-02 09:58:15 +02:00
samhed dfcedffc16 Make noVNC follow the RFB protocol and keep only one outstanding
framebufferUpdate request at a time.
2013-07-22 15:46:59 +02:00
samhed 406a8b4e96 Display the desktop name in the document title 2013-07-18 15:51:23 +02:00
Joel Martin 44ff863273 rfb.js: set FBU.bytes before waiting from RRE.
Also, in COPYRECT, set FBU.bytes to the number we know we will need.
2013-04-17 09:34:33 -05:00
Vagn Johansen 9f554fcdf7 Set FBU.bytes to 1 in encHandlers.COPYRECT
FBU.bytes must be set before return false to indicate that the FBU
header has been read. If not set then "if (FBU.bytes == 0) { ..}"
in framebufferUpdate will be entered and the copyrect header will
be interpreted as a new FBU leading to a "unsupported encoding"
disconnect error.
2013-04-16 19:17:50 +02:00
Joel Martin c95456c0e1 rfb.js: skip tight when true color is disabled.
Generally this means falling back to 8-bit colour mapped hextile which
is uses more bandwidth and is likely slower that tight with 24-bit
true color.

This is related to this query:
http://superuser.com/questions/484790/how-to-use-8-bit-mode-with-novnc
2012-10-23 16:21:22 -05:00
Joel Martin 6f4b1e4071 Refactor dynamic script loading. Add util.js:load_scripts()
Related to issue/pulls:
https://github.com/kanaka/noVNC/issues/194
https://github.com/kanaka/noVNC/pull/201
https://github.com/kanaka/noVNC/pull/202

In IE9, the window.onload event can fire before dynamically loaded
scripts have finished loading. This can result in either WebSocket (in
the case of vnc_auto.html) or RFB (in the case of vnc.html) not being
defined at the point when window.onload is called.

- Move the load_scripts routine from vnc.js to util.js (so that
  websockify can use it too). Also, refactor to work when load_scripts
  is called by a script that itself uses load_scripts. When the whole
  chain of dynamically loaded scripts is finished then call
  window.onscriptsload. Use this mechanism in all the places that
  depend on dynamic loading of scripts: vnc.html, vnc_auto.html,
  websock.js, tests/vnc_playback.html, and tests/vnc_perf.html.

- Use the new window.onscriptsload handler instead of window.onload.

- Remove include/start.js and do the script loading and startup event
  handling in include/ui.js instead.
2012-10-17 11:58:12 -05:00
Joel Martin e16ad2fd02 Refactoring hot blocks to help Chrome optimizing compiler. 2012-10-15 13:48:07 -05:00
Joel Martin 1d728ace69 Change noVNC license to from LGPLv3 to MPL 2.0
The MPL 2.0 license is a "file-level" copyleft license vs the
"project-level" nature of the L/GPL. The intention of noVNC has
always been that it should be easy to incorporate into existing
projects and sites whether free/open or proprietary/commercial. The MPL
2.0 is designed for this sort of combination project but still
requires that any distributed modifications to noVNC source files must
also be published under the same license.

In addition, the MPL 2.0 allows the code to be used in L/GPL projects
(the secondary license clause). This means that any projects that are
already incorporating noVNC should not be impacted by this change and
in fact it should clarify the licensing situation (the exact
application of the L/GPL to web applications and interpreted code is
somewhat ambiguous).

The HTML, CSS, image and font files continue to be under more
permissive licenses (see LICENSE.txt). The included websockify python
code remains under a LGPLv3 license although the include/websock.js
file from the websockify component is now under MPL 2.0 as well.

Permission was received from other noVNC authors to make this change to their
code license on the following dates:

    - Chris Gordon (UI): Jun 24, 2012
    - Antoine Mercadal (DOM,*util.js): Oct 10, 2012
    - William Lightning (UltraVNC repeater): Oct 10, 2012
    - Mike Tinglof (tight encoding): Oct 15, 2012
2012-10-15 13:35:00 -05:00
Joel Martin 51fc3b5f03 rfb.js: add onFBResize event callback. 2012-09-17 17:15:48 -05:00
Joel Martin fcff386b92 websock.js: simpler binary support, protocols param.
Use a simpler method of enabling binary transfer over WebSockets. This
still presents the user of websock.js with a plain javascript array
for the receive queue data. However, if binary support is supported
and requested then the transfer will be raw frames instead of base64
encoded.

Lots of room for optimization here but for now correct is better than
fast.

Pull from websockify 17175afd7311c55abd8d
2012-08-16 13:31:31 -05:00
Joel Martin 14717eb468 Fix tight decoding when using binary/non-base64 connection. 2012-08-15 12:45:53 -05:00
Joel Martin af1527b276 timers: fix over repeated connects.
With tight we can't ever use FBU.rects being 0 as an indication of
a full frame having been drawn.
2012-06-28 10:29:12 -05:00
Joel Martin d58f8b5144 License clarification: HTML,CSS,images,fonts under permissive licenses.
Clarify in LICENSE.txt that the noVNC core library is the part that is
LGPLv3 licensed. The HTML, CSS, images and fonts are separate from the
core library and can be modified and distributed with the noVNC core
but under their own license conditions.

HTML and CSS: 2-Clause BSD
Fonts: SIL OFL 1.1
Images: CC BY SA 3.0

In other words, you can modify the layout and appearance of of noVNC
to integrate with an existing or new web site or application without
having to publish the source for those modifications under the LGPLv3.
However, use of and modification of the noVNC core library (i.e. the
core Javascript that makes up noVNC) must still be according to the
LGPLv3.

Chris Gordon was the other contributor to the HTML, CSS, and images
included with noVNC and gave permission for this license clarification
on June 23, 2012.
2012-06-24 16:29:44 -05:00
Joel Martin b50f340674 UltraVNC repeaterID cleanup.
https://github.com/kanaka/noVNC/issues/103
https://github.com/kanaka/noVNC/pull/170
2012-06-23 14:22:47 -05:00
William Lightning 12acb663eb Change RepeaterID to be a config option 2012-06-22 22:30:05 -07:00
William Lightning 8d0c7fb5ac Add ultravnc_repeater.pl support to rfb.js and vnc_auto.html 2012-06-06 23:10:13 -07:00
Joel Martin 72a5596e50 rfb: Use the render queue for copyrect.
This will keep copyrect rendering actions in order with tight and tightPNG
rendering actions (otherwise you can get visual image corruption when
they are mixed together).

Warning:

RAW, RRE and HEXTILE still use immediate render commands so there is
still the risk of out-of-order rendering if RAW, RRE, and HEXTILE are
mixed with tight and tightPNG. Copyrect will work with either because
the renderQ_push function will render copyrects immediately if they
are the only thing being pushed on the queue.
2012-05-17 11:24:58 -05:00
Joel Martin 34d8b844ae Move render queue processing to Display and use requestAnimationFrame
The imgQ code in RFB should be a generic rendering queue system in
Display.

The reason for the render queue in the first place is that images
loaded from raw data URI strings aren't immediately ready to display
so we have to wait for them to complete 'loading'. However, when data
URI images are mixed with other types of rendering actions then things
can get out of order. This is the reason for the rendering queue.

Currently this only keeps display actions for tight and tightPNG
related actions in order (because they use a mix of fills, raw pixel
data and data URI images).
2012-05-17 11:13:08 -05:00
Joel Martin a0726a4b56 rfb: debug output cleanup. 2012-05-17 11:07:07 -05:00
Joel Martin dc6e501f20 Fail the connection on unexpected tightPNG cmode.
This related to https://github.com/kanaka/noVNC/issues/145

The real fix is to QEMU so that this doesn't happen which was
submitted as a patch to the mailinglist right before this.
2012-05-16 18:07:18 -05:00
Joel Martin bc28395abf Add/use display.drawImage which is viewport relative.
Fixes https://github.com/kanaka/noVNC/issues/163

When using an encoding with raw images (tight, tightPNG) we need to
draw those image relative to the viewport so that clipping works when
the viewport isn't at 0, 0.
2012-05-10 18:16:27 -05:00
Todd Freese 58ad83878c Added support for RealVNC Mac. 2012-05-10 12:29:36 -05:00
Joel Martin dcf1994d3e Don't treat onerror as a close.
The close event will also fire so trying to fail the connection twice
is unhelpful and hiding status information.
2012-04-25 20:13:25 -05:00
Joel Martin f8380ff939 Add code/reason to close event messages. Remove useless object print in error event. 2012-04-13 11:25:04 -05:00
Joel Martin f84504bc63 Support Apple Remote Desktop.
https://github.com/kanaka/noVNC/issues/58
2012-03-23 12:21:23 -05:00
Joel Martin ce86f5c954 Squelch noisy debug logs. 2012-03-13 20:24:24 -05:00
Joel Martin c0c20581f5 Merge tight/tightPNG routine.
Mostly duplicate code so merge it and wrap with closures that pass in
the isTightPNG parameter.

Still detect and error if copy/filter when tightPNG.
2012-03-12 15:34:56 -07:00
Joel Martin d065cad99e General code formatting and cleanliness. 2012-03-10 20:32:01 -06:00
Joel Martin a09a75e8f2 Stats: count pixels instead of just FBU.rects.
With last_rect, the rects count can be high until a last_rect
pseudo-encoding is received which messes with the timing stats. So
count up the number of pixels rendered and show timing after the pixel
count reaches the width*height of the screen.
2012-03-10 19:56:19 -06:00
Mike Tinglof d38db74abd add some documentation; default to existing websocket transport 2012-03-09 11:02:18 -05:00
Mike Tinglof 9b75bcaada add tight zlib stream reset; add error if tight encoding is used w/o true color 2012-01-31 00:15:56 -05:00
Mike Tinglof a14b8fae2a comment out per-decompress checksum and logging 2012-01-30 02:26:36 -05:00