Class Guacamole.Client
Defined in: Client.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Guacamole.Client(tunnel)
Guacamole protocol client.
|
Field Attributes | Field Name and Description |
---|---|
<inner> |
The underlying Guacamole display.
|
<inner> |
All available layers and buffers
|
Method Attributes | Method Name and Description |
---|---|
connect(data)
Connects the underlying tunnel of this Guacamole.Client, passing the
given arbitrary data to the tunnel during the connection process.
|
|
createClipboardStream(mimetype, name)
Opens a new clipboard object for writing, having the given mimetype.
|
|
createFileStream(mimetype, filename)
Opens a new file for writing, having the given index, mimetype and
filename.
|
|
createPipeStream(mimetype, name)
Opens a new pipe for writing, having the given name and mimetype.
|
|
Sends a disconnect instruction to the server and closes the tunnel.
|
|
endStream(index)
Marks a currently-open stream as complete.
|
|
Returns the underlying display of this Guacamole.Client.
|
|
<inner> |
getLayer(index)
Returns the layer with the given index, creating it if necessary.
|
sendAck(index, message, code)
Acknowledge receipt of a blob on the stream with the given index.
|
|
sendBlob(index, data)
Given the index of a file, writes a blob of data to that file.
|
|
sendKeyEvent(pressed, keysym)
Sends a key event having the given properties as if the user
pressed or released a key.
|
|
sendMouseState(mouseState)
Sends a mouse event having the properties provided by the given mouse
state.
|
|
sendSize(width, height)
Sends the current size of the screen.
|
|
setClipboard(data)
Sets the clipboard of the remote client to the given text data.
|
Event Attributes | Event Name and Description |
---|---|
onclipboard(stream, mimetype)
Fired when the clipboard of the remote client is changing.
|
|
onerror(status)
Fired when an error is reported by the remote client, and the connection
is being closed.
|
|
onfile(stream, mimetype, filename)
Fired when a file stream is created.
|
|
onname(name)
Fired when the remote client sends a name update.
|
|
onpipe(stream, mimetype, name)
Fired when a pipe stream is created.
|
|
onstatechange(state)
Fired whenever the state of this Guacamole.Client changes.
|
|
onsync(timestamp)
Fired whenever a sync instruction is received from the server, indicating
that the server is finished processing any input from the client and
has sent any results.
|
Class Detail
Guacamole.Client(tunnel)
Guacamole protocol client. Given a Guacamole.Tunnel,
automatically handles incoming and outgoing Guacamole instructions via the
provided tunnel, updating its display using one or more canvas elements.
- Parameters:
- {Guacamole.Tunnel} tunnel
- The tunnel to use to send and receive Guacamole instructions.
Field Detail
<inner>
display
The underlying Guacamole display.
<inner>
layers
All available layers and buffers
Method Detail
connect(data)
Connects the underlying tunnel of this Guacamole.Client, passing the
given arbitrary data to the tunnel during the connection process.
- Parameters:
- data
- Arbitrary connection data to be sent to the underlying tunnel during the connection process.
- Throws:
- {Guacamole.Status}
- If an error occurs during connection.
{Guacamole.OutputStream}
createClipboardStream(mimetype, name)
Opens a new clipboard object for writing, having the given mimetype.
- Parameters:
- {String} mimetype
- The mimetype of the data being sent.
- {String} name
- The name of the pipe.
- Returns:
- {Guacamole.OutputStream} The created file stream.
{Guacamole.OutputStream}
createFileStream(mimetype, filename)
Opens a new file for writing, having the given index, mimetype and
filename.
- Parameters:
- {String} mimetype
- The mimetype of the file being sent.
- {String} filename
- The filename of the file being sent.
- Returns:
- {Guacamole.OutputStream} The created file stream.
{Guacamole.OutputStream}
createPipeStream(mimetype, name)
Opens a new pipe for writing, having the given name and mimetype.
- Parameters:
- {String} mimetype
- The mimetype of the data being sent.
- {String} name
- The name of the pipe.
- Returns:
- {Guacamole.OutputStream} The created file stream.
disconnect()
Sends a disconnect instruction to the server and closes the tunnel.
endStream(index)
Marks a currently-open stream as complete.
- Parameters:
- {Number} index
- The index of the stream to end.
{Guacamole.Display}
getDisplay()
Returns the underlying display of this Guacamole.Client. The display
contains an Element which can be added to the DOM, causing the
display to become visible.
- Returns:
- {Guacamole.Display} The underlying display of this Guacamole.Client.
<inner>
{Guacamole.Display.VisibleLayer|Guacamole.Layer}
getLayer(index)
Returns the layer with the given index, creating it if necessary.
Positive indices refer to visible layers, an index of zero refers to
the default layer, and negative indices refer to buffers.
- Parameters:
- {Number} index
- The index of the layer to retrieve.
- Returns:
- {Guacamole.Display.VisibleLayer|Guacamole.Layer} The layer having the given index.
sendAck(index, message, code)
Acknowledge receipt of a blob on the stream with the given index.
- Parameters:
- {Number} index
- The index of the stream associated with the received blob.
- {String} message
- A human-readable message describing the error or status.
- {Number} code
- The error code, if any, or 0 for success.
sendBlob(index, data)
Given the index of a file, writes a blob of data to that file.
- Parameters:
- {Number} index
- The index of the file to write to.
- {String} data
- Base64-encoded data to write to the file.
sendKeyEvent(pressed, keysym)
Sends a key event having the given properties as if the user
pressed or released a key.
- Parameters:
- {Boolean} pressed
- Whether the key is pressed (true) or released (false).
- {Number} keysym
- The keysym of the key being pressed or released.
sendMouseState(mouseState)
Sends a mouse event having the properties provided by the given mouse
state.
- Parameters:
- {Guacamole.Mouse.State} mouseState
- The state of the mouse to send in the mouse event.
sendSize(width, height)
Sends the current size of the screen.
- Parameters:
- {Number} width
- The width of the screen.
- {Number} height
- The height of the screen.
setClipboard(data)
Sets the clipboard of the remote client to the given text data.
- Parameters:
- {String} data
- The data to send as the clipboard contents.
- Deprecated:
- Use createClipboardStream() instead.
Event Detail
onclipboard(stream, mimetype)
Fired when the clipboard of the remote client is changing.
- Parameters:
- {Guacamole.InputStream} stream
- The stream that will receive clipboard data from the server.
- {String} mimetype
- The mimetype of the data which will be received.
onerror(status)
Fired when an error is reported by the remote client, and the connection
is being closed.
- Parameters:
- {Guacamole.Status} status
- A status object which describes the error.
onfile(stream, mimetype, filename)
Fired when a file stream is created. The stream provided to this event
handler will contain its own event handlers for received data.
- Parameters:
- {Guacamole.InputStream} stream
- The stream that will receive data from the server.
- {String} mimetype
- The mimetype of the file received.
- {String} filename
- The name of the file received.
onname(name)
Fired when the remote client sends a name update.
- Parameters:
- {String} name
- The new name of this client.
onpipe(stream, mimetype, name)
Fired when a pipe stream is created. The stream provided to this event
handler will contain its own event handlers for received data;
- Parameters:
- {Guacamole.InputStream} stream
- The stream that will receive data from the server.
- {String} mimetype
- The mimetype of the data which will be received.
- {String} name
- The name of the pipe.
onstatechange(state)
Fired whenever the state of this Guacamole.Client changes.
- Parameters:
- {Number} state
- The new state of the client.
onsync(timestamp)
Fired whenever a sync instruction is received from the server, indicating
that the server is finished processing any input from the client and
has sent any results.
- Parameters:
- {Number} timestamp
- The timestamp associated with the sync instruction.