mirror of
https://github.com/novnc/noVNC.git
synced 2026-05-27 15:39:41 +00:00
Abstract RFB errors to avoid sending strings
The API allowed strings to be passed from the RFB module to the application using the disconnect reason. This caused problems since the application didn't have control over translations for these strings. Most of the information being passed using this string was very technical and not helpful to the end user. One exception to this was the security result information regarding for example authentication failures. The protocol allows the VNC server to pass a string directly to the user in the security result. So the disconnect reason is replaced by a boolean saying if the disconnection was clean or not. And for the security result information from the server, a new event has been added.
This commit is contained in:
32
docs/API.md
32
docs/API.md
@@ -74,6 +74,10 @@ protocol stream.
|
||||
- The `credentialsrequired` event is fired when more credentials must
|
||||
be given to continue.
|
||||
|
||||
[`securityfailure`](#securityfailure)
|
||||
- The `securityfailure` event is fired when the security negotiation
|
||||
with the server fails.
|
||||
|
||||
[`clipboard`](#clipboard)
|
||||
- The `clipboard` event is fired when clipboard data is received from
|
||||
the server.
|
||||
@@ -186,10 +190,10 @@ the `RFB` object is ready to recieve graphics updates and to send input.
|
||||
#### disconnect
|
||||
|
||||
The `disconnect` event is fired when the connection has been
|
||||
terminated. The `detail` property is an `Object` the optionally
|
||||
contains the property `reason`. `reason` is a `DOMString` specifying
|
||||
the reason in the event of an unexpected termination. `reason` will be
|
||||
omitted for a clean termination.
|
||||
terminated. The `detail` property is an `Object` that contains the
|
||||
property `clean`. `clean` is a `boolean` indicating if the termination
|
||||
was clean or not. In the event of an unexpected termination or an error
|
||||
`clean` will be set to false.
|
||||
|
||||
#### credentialsrequired
|
||||
|
||||
@@ -198,6 +202,26 @@ credentials than were specified to [`RFB()`](#rfb-1). The `detail`
|
||||
property is an `Object` containing the property `types` which is an
|
||||
`Array` of `DOMString` listing the credentials that are required.
|
||||
|
||||
#### securityfailure
|
||||
|
||||
The `securityfailure` event is fired when the handshaking process with
|
||||
the server fails during the security negotiation step. The `detail`
|
||||
property is an `Object` containing the following properties:
|
||||
|
||||
| Property | Type | Description
|
||||
| -------- | ----------- | -----------
|
||||
| `status` | `long` | The failure status code
|
||||
| `reason` | `DOMString` | The **optional** reason for the failure
|
||||
|
||||
The property `status` corresponds to the
|
||||
[SecurityResult](https://github.com/rfbproto/rfbproto/blob/master/rfbproto.rst#securityresult)
|
||||
status code in cases of failure. A status of zero will not be sent in
|
||||
this event since that indicates a successful security handshaking
|
||||
process. The optional property `reason` is provided by the server and
|
||||
thus the language of the string is not known. However most servers will
|
||||
probably send English strings. The server can choose to not send a
|
||||
reason and in these cases the `reason` property will be omitted.
|
||||
|
||||
#### clipboard
|
||||
|
||||
The `clipboard` event is fired when the server has sent clipboard data.
|
||||
|
||||
Reference in New Issue
Block a user