]> git.proxmox.com Git - mirror_novnc.git/blobdiff - docs/API.md
Fixed a race condition when attaching to an existing socket
[mirror_novnc.git] / docs / API.md
index c5923e3fbbd97532705e78f8bab5bdcfc45c0abc..81b517b13577b536091e203258922b21f34bd4bd 100644 (file)
@@ -24,13 +24,7 @@ protocol stream.
 `focusOnClick`
   - Is a `boolean` indicating if keyboard focus should automatically be
     moved to the remote session when a `mousedown` or `touchstart`
-    event is received.
-
-`touchButton`
-  - Is a `long` controlling the button mask that should be simulated
-    when a touch event is recieved. Uses the same values as
-    [`MouseEvent.button`](https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button).
-    Is set to `1` by default.
+    event is received. Enabled by default.
 
 `clipViewport`
   - Is a `boolean` indicating if the remote session should be clipped
@@ -53,6 +47,30 @@ protocol stream.
     should be sent whenever the container changes dimensions. Disabled
     by default.
 
+`showDotCursor`
+  - Is a `boolean` indicating whether a dot cursor should be shown
+    instead of a zero-sized or fully-transparent cursor if the server
+    sets such invisible cursor. Disabled by default.
+
+`background`
+  - Is a valid CSS [background](https://developer.mozilla.org/en-US/docs/Web/CSS/background)
+    style value indicating which background style should be applied
+    to the element containing the remote session screen. The default value is `rgb(40, 40, 40)`
+    (solid gray color).
+
+`qualityLevel`
+  - Is an `int` in range `[0-9]` controlling the desired JPEG quality.
+    Value `0` implies low quality and `9` implies high quality.
+    Default value is `6`.
+
+`compressionLevel`
+  - Is an `int` in range `[0-9]` controlling the desired compression
+    level. Value `0` means no compression. Level 1 uses a minimum of CPU
+    resources and achieves weak compression ratios, while level 9 offers
+    best compression but is slow in terms of CPU consumption on the server
+    side. Use high levels with very slow network connections.
+    Default value is `2`.
+
 `capabilities` *Read only*
   - Is an `Object` indicating which optional extensions are available
     on the server. Some methods may only be called if the corresponding
@@ -137,7 +155,7 @@ connection to a specified VNC server.
 
 ##### Syntax
 
-    var rfb = new RFB( target, url [, options] );
+    let rfb = new RFB( target, url [, options] );
 
 ###### Parameters
 
@@ -147,9 +165,14 @@ connection to a specified VNC server.
     existing contents of the `HTMLElement` will be untouched, but new
     elements will be added during the lifetime of the `RFB` object.
 
-**`url`**
+**`urlOrDataChannel`**
   - A `DOMString` specifying the VNC server to connect to. This must be
-    a valid WebSocket URL.
+    a valid WebSocket URL. This can also be a `WebSocket` or `RTCDataChannel`.
+    If a `DOMString` is supplied then the connection will be delayed until the next tick to
+    allow allow adding event listeners that fire on connection. If an existing object
+    is supplied then the connection logic happens the same tick. For instance if passing
+    in an existing open WebSocket then it will not be possible to listen for the `connect`
+    event. This is to avoid dropping data on a connection that has data as soon as its opened.
 
 **`options`** *Optional*
   - An `Object` specifying extra details about how the connection
@@ -176,6 +199,10 @@ connection to a specified VNC server.
       - A `DOMString` specifying the ID to provide to any VNC repeater
         encountered.
 
+    `wsProtocols`
+      - An `Array` of `DOMString`s specifying the sub-protocols to use
+        in the WebSocket connection. Empty by default.
+
 #### connect
 
 The `connect` event is fired after all the handshaking with the server
@@ -360,5 +387,4 @@ to the remote server.
 ###### Parameters
 
 **`text`**
-  - A `DOMString` specifying the clipboard data to send. Currently only
-  characters from ISO 8859-1 are supported.
+  - A `DOMString` specifying the clipboard data to send.