]> 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 1b00179e1e312e9aab2bd7a570de4a172142d8e8..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
@@ -69,6 +63,14 @@ protocol stream.
     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
@@ -163,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
@@ -380,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.