Commit Graph

306 Commits

Author SHA1 Message Date
Matt McClaskey 437830d497
Feature/kasm 3380 udp frame (#46)
* Handle the frame id in udp packets

* refactor udp message buffer, add frame_id and rect cnt

* refactor udp to work with new display.js

* additional debug metrics, clear frame buffer on transitions tcp/udp

* fix udp with display refactor, KASM-3541 cancelAnimationFrame

Co-authored-by: Lauri Kasanen <cand@gmx.com>
Co-authored-by: mattmcclaskey <matt@kasmweb.com>
2022-11-11 09:31:16 -05:00
Matt McClaskey 3a6a63cde3
KASM-3102 Allow setting the idle timeout (#41)
refactor idle timeout to use date diff
2022-11-11 09:29:52 -05:00
Anthony Merrill a97fa93d84
Bug/kasm 3355 multibyte issue (#42)
Fix clipboard server to client decoding of multi-byte characters
2022-11-04 07:13:19 -04:00
Matt McClaskey 9f240fc7b1
Major refactor of display class, support for QOI (#43)
* Major refactor of display.js queue to assume async rect processing in order to accommodate threaded decode or udp

* QOI lossless decoder on worker threads using WASM

* rfb.js class to provide frame_id and rect counts per frame

Co-authored-by: ryan.kuba <ryan.kuba@kasmweb.com>
Co-authored-by: matt <matt@kasmweb.com>
2022-11-02 07:01:54 -04:00
Matt McClaskey 9a95983382
KASM-3367 Refactor display.js, direct to visible canvas (#40)
* refactor display.js, remove non-visible canvas and concept of damage

* tweaks to UDP transitions

* Update testing readme

Co-authored-by: matt <matt@kasmweb.com>
Co-authored-by: matt mcclaskey <matt@kamsweb.com>
2022-10-14 15:07:57 -04:00
Dmitry Maksyoma 26c97c1dd3
Feature/kasm 2346 extend mouse buttons (#39)
* Extend mouse event button mask to 16 bits

* Mouse button mapping (JS -> Xorg) support

* Refactor: extract XVNC_BUTTONS

* Refactor: XVNC_BUTTONS numbers correspond to X button numbers

* Refactor

Co-authored-by: Lauri Kasanen <cand@gmx.com>
2022-10-14 12:52:19 -04:00
Matt McClaskey acb64b01b3
Fix send clipboard seamless client to server (#34)
Co-authored-by: mmcclaskey <matt@kasmweb.com>
2022-09-16 14:35:53 -04:00
Matt McClaskey 842d7ad938
added udp toggle in UI, added err handling (#33)
Co-authored-by: Matt McClaskey <matt@kasmweb.com>
2022-09-07 05:40:29 -04:00
Matt McClaskey 5a8d8f24b4
Udp Initial MVP (#32)
* Initial UDP code

* refactored UDP reassembly

* WIP Added udp decoder

* WIP cleanup

* Port multiplexing

* UDP upgrade/downgrade

* UDP packets now have a hash

* Correct udp.js this.numColors bug

* auto upgrade to udp

* re-apply webpack

* Code cleanup, optimize clearing udpBuffer

Co-authored-by: Lauri Kasanen <cand@gmx.com>
Co-authored-by: matt <matt@kasmweb.com>
2022-07-29 12:38:55 -04:00
Matt McClaskey 1753425874
Pointer lock api (#29)
Add pointer lock and relative cursor position support. Game mode enables both pointer lock and relative cursor positions.
2022-05-03 10:37:22 -04:00
Matt McClaskey 6c708d8254
Feature/kasm 2445 clipboard ids (#28)
Adds IDs to clipboard operations for use in DLP, logging, and general attribution.
2022-04-05 08:56:54 -04:00
Matt McClaskey 385a1f99b4
Feature/kasm 2335 ime support 2 (#27)
IME support, refactored keyboard input
2022-03-25 15:03:19 -04:00
Matt McClaskey df9c9d0d96
Bugfix/kasm 2242 clipboard sync (#26)
* KASM-2242 clipboard behavior correction

* remove clipboard length check

Co-authored-by: matt <matt@kasmweb.com>
2022-01-31 09:39:19 -05:00
mmcclaskey ad1fc1f06d
KASM-2152 fps added to stats (#25)
Co-authored-by: matt <matt@kasmweb.com>
2022-01-11 15:31:39 -05:00
Mariusz Marciniak c20db143a0 KASM-2108 Update Kasm<->noVNC communication for mobile related features 2021-11-15 13:53:58 +00:00
Mariusz Marciniak a8a3651898 KASM-2001 Add keyboard controls panel 2021-11-08 21:22:39 +00:00
mmcclaskey 2faf2049c2
Bugfix/kasm 2053 video quality (#19)
* KASM-2053 Fixes previous issues where there was no difference between medium and high
* Expands quality settings to adjust more rendering settings
* Adds an extreme quality setting and custom
* Adds the quality setting to the noVNC control panel, was previously only exposed in the backend for integration with Kasm Workspaces
* Switching quality settings no longer requires reconnecting.
2021-11-08 12:57:24 -05:00
mmcclaskey e11e76e2c7
Feature/kasm 2041 mobile scaling (#20)
* KASM-2041 auto scale high res mobile - Browsers typically set a scale ratio for high resolution screens, so everything isn't tiny. This mostly works well, but results in a super low resolution for the remote display. This feature detects low resolutions where the browser is doing scaling and adjusts the scale backwards to reach a more reasonable resolution. This typically only happens on modern phones.
2021-11-08 12:55:37 -05:00
Mariusz Marciniak 66c5812b4e KASM-2034 Unlock mobile audio playing on first mobile touch event 2021-11-03 12:27:01 +00:00
matt a36f941493 fix Edge 18 and under clipboard 2021-10-15 19:34:01 +00:00
matt 37c41c60f6 Fixes for older Chrome browsers 2021-10-14 17:33:03 +00:00
matt 0bd7bf8b3e rebase from master 2021-10-12 18:36:43 +00:00
matt f8fde81dfb WIP: cleanup code 2021-10-12 14:11:26 +00:00
matt f3418af9b7 WIP: fix recieving large binary cliipboard 2021-10-08 15:08:12 +00:00
Mariusz Marciniak d20e5d78fa KASM-1968 Add support for CMD+click on MacOs 2021-10-07 12:05:45 +02:00
Mariusz Marciniak 66cc16a894 KASM-1980 Add support for CMD right + key shortcuts on MacOs 2021-10-07 12:04:33 +02:00
Mariusz Marciniak fff810d45a KASM-1871 Add smooth scrolling by sending scroll delta directly 2021-10-07 11:58:46 +02:00
Mariusz Marciniak 09707e9820 KASM-1882 Improved pinch&zoom responsiveness 2021-10-07 11:58:46 +02:00
Mariusz Marciniak f509f5231a KASM-1890 Add MacOS shortcut translation 2021-10-07 11:58:46 +02:00
matt 8842f372b8 WIP, firefox support 2021-10-01 19:02:51 +00:00
matt c533d18ac7 Merge branch 'master' into chromeclip 2021-10-01 09:03:09 +00:00
matt e7c601efc0 clipboard WIP 2021-10-01 09:03:03 +00:00
matt 34bfdddab5 KASM-1947 binary clipboard WIP 2021-09-23 08:39:37 +00:00
matt 141f91fde5 KASM-1947 WIP 2021-09-21 09:38:34 +00:00
matt 3c477925f3 KASM-1947 send png WIP 2021-09-17 13:47:11 +00:00
matt f165845c2d KASM-1947 binary clipboard WIP 2021-09-16 19:16:49 +00:00
Lauri Kasanen effc0eee02 Initial binary clipboard support 2021-09-16 15:32:26 +03:00
matt a0907e9390 KASM-1834 added new anti-aliasing feature 2021-09-12 17:53:03 +00:00
matt 4c8e8ef1e1 KASM-1834 disable anti-aliasing when screen ratio is 1:1 2021-09-10 17:31:44 +00:00
Mariusz Marciniak ace35fa652 KASM-1882 MacOs pinch and zoom 2021-08-31 10:39:47 +02:00
Mariusz Marciniak 8453916f9c KASM-1881 Add MacOs cmd+wheel zoom support 2021-08-30 21:28:13 +02:00
mmcclaskey 519a40213b
Merge pull request #6 from kasmtech/apistats
Apistats
2021-08-05 11:01:03 -04:00
matt 30326f7c11 KASM-1834 expose quality settings 2021-08-02 17:13:01 +00:00
matt d7d748e05a fixed time tracking 2021-07-30 17:07:44 +00:00
Lauri Kasanen f9f5b01cc2 Initial frame stat tracking 2021-07-27 15:28:02 +03:00
Kasm c02aca5c13
restoring behavior of KasmVNC 2021-04-22 08:37:43 -04:00
Kasm 94c67f501f
Remove istouch variable 2021-04-21 20:04:25 -04:00
matt 1a823c85d9 various bug fixes 2021-04-11 18:33:30 +00:00
matt be658061e8 Fixes 2021-03-30 16:40:32 -04:00
matt f1d7df548a KasmVNC changes merged manually 2021-03-30 15:03:34 -04:00
lhchavez f9a8c4ccd5 Add VeNCrypt Plain authentication tests
This change adds tests for the VeNCrypt Plain authentication. In doing
that, this also fixes a typo that was introduced in a recent change.
2021-03-13 05:40:38 -08:00
Pierre Ossman 9ca337d3a8 Merge branch 'homogenize-credentials-testing' of https://github.com/lhchavez/noVNC 2021-03-11 16:47:35 +01:00
Pierre Ossman 4c96d4b7bd Merge branch 'feature/support-existing-rtcdatachannel-or-websocket-squashed' of https://github.com/TimSBSquare/noVNC 2021-03-11 16:30:22 +01:00
lhchavez 0c55c64757 Normalize the credentials presence check
Most places that check for the presence / absence of credentials compare
them against `undefined`, except the one for Plain authentication.

This change makes the very last place to use the same pattern (instead
of checking for falsiness) for consistency. Additionally, there are ways
to configure PAM to accept empty passwords, so it's possible for a user
to legitimately send an empty string as password.
2021-03-11 06:42:11 -08:00
Tim Stableford 44d384b99c Added support for RTCDataChannel
This work is originally by Ryan Castner <castner.rr@gmail.com> and
submitted as a PR here https://github.com/novnc/noVNC/pull/1362

Architecturally it is much the same except it doesn't rename a lot
of variables to make this more reviewable. It also avoids unrelated
changes such as replacing .onclose with an event listener, which
caused numerous test failures.

It also adds in ppoffice's fix to initialise the buffers.

Like the original author I don't have enough time available to
refactor this project to the new style event listeners.

Review cleanup for RTCDataChannel support (see below)

* More descriptive error when url or channel not set.
* Moved websocket property check to WebSock.
  This had unintended consequences in the tests that required some
  fixup. Mostly due to some tests not always passing FakeWebsocket.
  FakeWebsocket also needs to set the listeners to null to be compatible
  with what is in thw browser and expected by the property check code.
  The property check code now also takes into account class prototypes
  for test compatibility.
* Removed unreachable code.
* Reverted comment.
* Cleanup raw channel reference in rfb on websock close.
* Use readyState to check whether a socket is open rather than assuming.
* Updated RFB constructor documentation

Removed an unused boolean passed to attach
2021-03-04 18:55:06 +00:00
lhchavez 18593154d3 Allow longer passwords in Plain authentication
Some people have longer passwords than 256 characters (hooray for
password managers!). Server implementations also allow longer passwords:
TigerVNC allows up to 1024 characters.
2021-03-03 17:34:02 -08:00
Pierre Ossman 6a4c411976 Remove createEvent() fallbacks
We can now rely on proper constructors for our events.
2020-12-07 10:10:53 +01:00
Pierre Ossman 5b5b747494 Remove many small, obsolete, old browser hacks
These are for browsers no longer supported anyway.
2020-12-07 10:10:53 +01:00
Pierre Ossman 0630352e19 Merge branch 'rgbx' of https://github.com/CendioOssman/noVNC 2020-09-04 13:40:23 +02:00
Pierre Ossman 57ba67f306 Alway focus on touchstart
The new gesture detection code will always prevent the default behaviour
of touchstart, so this check no longer works properly. We might want to
add something similar to GestureHandler in the future, but let's wait
and see what use cases are requested.
2020-06-16 15:32:38 +02:00
Samuel Mannehed 32ed7c6724 Fake cursor position when using touch
With the new gestures we will simulate the cursor being in a different
location than any of the touch points. This is a bit too complex for the
Cursor class, so let's just explicitly tell it where we want the cursor
rendered.
2020-06-12 14:36:10 +02:00
Pierre Ossman 50cde2faab Move mouse event handling to RFB class
Move the last remaining bits to the RFB class to keep things simple, as
the Mouse class no longer provides any real value.
2020-06-12 14:36:10 +02:00
Pierre Ossman 88589a44f7 Increase wheel step threshold
The previous value made the detection too sensitive and it was very
difficult to scroll precisely. A value of 50 pixels should give similar
behaviour to systems that don't do fine grained scrolling.
2020-06-12 09:18:46 +02:00
Pierre Ossman f84bc57bda Move wheel event handling to RFB class
The Mouse class does very little now so it mostly just obfuscate things.
Move everything directly in to the RFB class instead.
2020-06-12 09:18:46 +02:00
Pierre Ossman 8be924c9d9 Add touch gestures for mouse emulation
Add several single and multitouch gestures to simulate various mouse
actions that would otherwise be impossible to perform.

This replaces the old system where you could select which mouse button
a single touch would generate.
2020-06-12 09:18:46 +02:00
Pierre Ossman 6a19390baa Switch to RGBx pixel format
This is what the browser wants so it avoids having to spend time
converting everything. Unfortunately it usually means the server instead
needs to convert it for us, but we assume it has more power than we do.
2020-06-08 07:57:17 +02:00
Pierre Ossman f694c32fd5 Merge branch 'camelcase' of https://github.com/samhed/noVNC 2020-06-05 09:41:25 +02:00
Samuel Mannehed ea858bfa27 Standardize on camelCase in Websock 2020-05-31 23:21:35 +02:00
Samuel Mannehed 80187d158c Standardize on camelCase in RFB 2020-05-31 23:21:35 +02:00
Samuel Mannehed dff4fefa3c Remove unused properties and variables
The code that used these were removed in the following commits:

* 9ff86fb718 (RFB._mouse_arr)
* bb6965f2e6 (old_requestAnimationFrame)
* 490d471c53 (Display._c_forceCanvas)
2020-05-31 22:49:41 +02:00
Samuel Mannehed 150596be83 Properly limit mouse moves to once every 17 ms
Previous attempt in c958269 had a number of issues, this is a full
rewrite, complete with improved unit tests.

Fixes github issue #1402
2020-05-31 00:53:15 +02:00
Samuel Mannehed 11a22dbf0c Stop send mouse clicks while dragging in view only 2020-05-31 00:53:15 +02:00
Samuel Mannehed 006743857b Standardize on camelCase for functions in RFB 2020-05-31 00:53:15 +02:00
Samuel Mannehed e7dec5270e Standardize on camelCase for variables in RFB 2020-05-31 00:53:15 +02:00
Samuel Mannehed b5ff33a556 Remove unused mouse_arr variable 2020-05-08 22:30:20 +02:00
Samuel Mannehed 479d8cefd1 Add ability to set compression level
Fixes github issue #1382.
2020-05-01 20:47:36 +02:00
Filip Stedronsky a1015d8db5 rfb: VeNCrypt Plain SecurityType support
This allows using TigerVNC server with PAM authentication (e.g. agains
LDAP or other extensible authentication mechanisms)

Tested with TigerVNC server (Xvnc -SecurityTypes Plain -PlainUsers '*')

Should not break anything else, this method is tried last when all
other fail.

Tested in Firefox 74 and Chromium 80
2020-04-08 08:58:32 +02:00
Andrey Trebler efd1f8a4f2 adds qualityLevel property to RFB class for updating JPEG quality level encoding on the fly 2020-02-28 13:14:19 +01:00
Alex Tanskanen ceb8ef4ec1 Fix crash with too large clipboard data
If too much text is copied in the session, String.fromCharCode.apply()
would crash in Safari on macOS and Chrome on Linux. This commit fixes
this issue by avoiding apply() altogether. Also added test to cover this
issue.
2020-02-21 09:39:31 +01:00
Pierre Ossman 384232fb56 Merge branch 'clipboard_unicode' of https://github.com/CendioNiko/noVNC 2020-02-18 09:46:10 +01:00
Niko Lehto f73fdc3ed3 Add extended clipboard Pseudo-Encoding
Add extended clipboard pseudo-encoding to allow the use of unicode
characters in the clipboard.
2020-02-18 09:32:36 +01:00
Samuel Mannehed 71bb3fdfa5 Fix color channels for VMware alpha cursors
The red and blue channels were incorrectly swapped.
2020-01-30 11:48:17 +01:00
Pierre Ossman 49db41ea4b Allow cursor to be updated while connecting
We haven't got a server provided cursor at this point, but we might
have done something local, e.g. enabled the dot cursor.
2019-12-30 09:30:00 +01:00
Samuel Mannehed 2cf82a5c8e Build in the behavior to ignore decodeUTF8 errors
Makes the code clearer and more explicit in intent.
2019-12-23 10:27:40 +01:00
VanyM ff1b10ca66
Add try catch in every place that uses decodeUTF8 2019-12-06 09:44:11 +03:00
Chris "Koying" Browet 1c9826140a Add support for Unix Tight auth 2019-12-05 15:46:31 +01:00
Chris J 01d4514dee Allow connecting with empty string credentials
Checking for undefined instead of falsy. That way an empty strings are allowed.
2019-12-05 12:13:11 +01:00
Samuel Mannehed 412d93060d Update copyright to 2019 for modified files 2019-09-30 15:35:33 +02:00
Samuel Mannehed 3055307d3d
Merge pull request #1299 from CendioNiko/vmwarecursor
Add support for VMware cursor encoding
2019-09-25 14:45:29 +02:00
Niko Lehto 296ba51f49 Add support for VMware cursor encoding
Supports both classic cursor type and alpha cursor type. In classic
mode the server can send 'inverted' pixels for the cursor, our code
does not support this but handles these pixels as opaque black.

Co-authored-by: Samuel Mannehed <samuel@cendio.se>
2019-09-24 10:26:30 +02:00
Niko Lehto ce66b46986 Add support for DesktopName extension
This extension allows session name to be changed during runtime.
2019-09-04 14:23:37 +02:00
Pierre Ossman e5255fc246 Remove pointless Display.clear()
It served no meaningful purpose and it had bugs. So let's remove it
rather than try to fix it.
2019-08-23 15:05:58 +02:00
Pierre Ossman 6aed0b4dd2 Deprecate showDotCursor option for RFB constructor
It is not relevant for the connection stage so it should not have
been a constructor argument to begin with. Ship with a warning for
a release before we remove it.
2019-08-23 14:00:20 +02:00
Pierre Ossman 1f2bb52850 Make sure showDotCursor can be modified before connecting
The cursor object is only attached to our canvas whilst connecting,
so we need to make sure we don't try to update anything when were
not connected or we'll get a crash.
2019-08-23 13:57:30 +02:00
Samuel Mannehed c912230309 Remove the default value of wsProtocols
Using the 'binary' protocol by default is very non-standard.
2019-07-23 16:03:49 +02:00
Shira Maximov 25b3d49d32 Add support in websocket sub-protocols 2019-07-23 13:44:18 +03:00
Pierre Ossman 755d6eae99 Remove server pixel format warnings
These are harmless and really only for debugging. So remove them
as they tend to trick people in to thinking something is wrong.
We already print the entire server pixel format earlier anyway in
case we need the details.
2019-05-24 13:06:26 +02:00
Juanjo Diaz 0505214cd9 Convert DES into a class 2019-02-26 23:53:43 +02:00
Pierre Ossman b00a608af7 Remove error handling in clientCutText()
It is not necessary as Websock.flush() is guaranteed to succeed and
give us some space. It also remove the call to _fail(), which was
invalid at this place as clientCutText() is not a method on RFB.
2019-02-15 13:14:36 +01:00
Pierre Ossman c02b18f06f Clean up RFB._rfb_auth_schema assignment 2019-02-15 10:25:50 +01:00