Class: Client

Guacamole.Client

new 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:
Name Type Description
tunnel Guacamole.Tunnel The tunnel to use to send and receive Guacamole instructions.
Source:

Methods

connect(data)

Connects the underlying tunnel of this Guacamole.Client, passing the given arbitrary data to the tunnel during the connection process.
Parameters:
Name Type Description
data Arbitrary connection data to be sent to the underlying tunnel during the connection process.
Source:
Throws:
If an error occurs during connection.
Type
Guacamole.Status

createAudioStream(mimetype) → {Guacamole.OutputStream}

Opens a new audio stream for writing, where audio data having the give mimetype will be sent along the returned stream. The instruction necessary to create this stream will automatically be sent.
Parameters:
Name Type Description
mimetype String The mimetype of the audio data that will be sent along the returned stream.
Source:
Returns:
The created audio stream.
Type
Guacamole.OutputStream

createClipboardStream(mimetype, name) → {Guacamole.OutputStream}

Opens a new clipboard object for writing, having the given mimetype. The instruction necessary to create this stream will automatically be sent.
Parameters:
Name Type Description
mimetype String The mimetype of the data being sent.
name String The name of the pipe.
Source:
Returns:
The created file stream.
Type
Guacamole.OutputStream

createFileStream(mimetype, filename) → {Guacamole.OutputStream}

Opens a new file for writing, having the given index, mimetype and filename. The instruction necessary to create this stream will automatically be sent.
Parameters:
Name Type Description
mimetype String The mimetype of the file being sent.
filename String The filename of the file being sent.
Source:
Returns:
The created file stream.
Type
Guacamole.OutputStream

createObjectOutputStream(index, mimetype, name) → {Guacamole.OutputStream}

Creates a new output stream associated with the given object and having the given mimetype and name. The legality of a mimetype and name is dictated by the object itself. The instruction necessary to create this stream will automatically be sent.
Parameters:
Name Type Description
index Number The index of the object for which the output stream is being created.
mimetype String The mimetype of the data which will be sent to the output stream.
name String The defined name of an output stream within the given object.
Source:
Returns:
An output stream which will write blobs to the named output stream of the given object.
Type
Guacamole.OutputStream

createOutputStream() → {Guacamole.OutputStream}

Allocates an available stream index and creates a new Guacamole.OutputStream using that index, associating the resulting stream with this Guacamole.Client. Note that this stream will not yet exist as far as the other end of the Guacamole connection is concerned. Streams exist within the Guacamole protocol only when referenced by an instruction which creates the stream, such as a "clipboard", "file", or "pipe" instruction.
Source:
Returns:
A new Guacamole.OutputStream with a newly-allocated index and associated with this Guacamole.Client.
Type
Guacamole.OutputStream

createPipeStream(mimetype, name) → {Guacamole.OutputStream}

Opens a new pipe for writing, having the given name and mimetype. The instruction necessary to create this stream will automatically be sent.
Parameters:
Name Type Description
mimetype String The mimetype of the data being sent.
name String The name of the pipe.
Source:
Returns:
The created file stream.
Type
Guacamole.OutputStream

disconnect()

Sends a disconnect instruction to the server and closes the tunnel.
Source:

endStream(index)

Marks a currently-open stream as complete. The other end of the Guacamole connection will be notified via an "end" instruction that the stream is closed, and the index will be made available for reuse in future streams.
Parameters:
Name Type Description
index Number The index of the stream to end.
Source:

getDisplay() → {Guacamole.Display}

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.
Source:
Returns:
The underlying display of this Guacamole.Client.
Type
Guacamole.Display

requestObjectInputStream(index, name)

Requests read access to the input stream having the given name. If successful, a new input stream will be created.
Parameters:
Name Type Description
index Number The index of the object from which the input stream is being requested.
name String The name of the input stream to request.
Source:

sendAck(index, message, code)

Acknowledge receipt of a blob on the stream with the given index.
Parameters:
Name Type Description
index Number The index of the stream associated with the received blob.
message String A human-readable message describing the error or status.
code Number The error code, if any, or 0 for success.
Source:

sendBlob(index, data)

Given the index of a file, writes a blob of data to that file.
Parameters:
Name Type Description
index Number The index of the file to write to.
data String Base64-encoded data to write to the file.
Source:

sendKeyEvent(pressed, keysym)

Sends a key event having the given properties as if the user pressed or released a key.
Parameters:
Name Type Description
pressed Boolean Whether the key is pressed (true) or released (false).
keysym Number The keysym of the key being pressed or released.
Source:

sendMouseState(mouseState)

Sends a mouse event having the properties provided by the given mouse state.
Parameters:
Name Type Description
mouseState Guacamole.Mouse.State The state of the mouse to send in the mouse event.
Source:

sendSize(width, height)

Sends the current size of the screen.
Parameters:
Name Type Description
width Number The width of the screen.
height Number The height of the screen.
Source:

setClipboard(data)

Sets the clipboard of the remote client to the given text data.
Parameters:
Name Type Description
data String The data to send as the clipboard contents.
Deprecated:
  • Use createClipboardStream() instead.
Source:

Events

onaudio

Fired when a audio stream is created. The stream provided to this event handler will contain its own event handlers for received data.
Parameters:
Name Type Description
stream Guacamole.InputStream The stream that will receive audio data from the server.
mimetype String The mimetype of the audio data which will be received.
Source:
Returns:
An object which implements the Guacamole.AudioPlayer interface and has been initialied to play the data in the provided stream, or null if the built-in audio players of the Guacamole client should be used.
Type
Guacamole.AudioPlayer

onclipboard

Fired when the clipboard of the remote client is changing.
Parameters:
Name Type Description
stream Guacamole.InputStream The stream that will receive clipboard data from the server.
mimetype String The mimetype of the data which will be received.
Source:

onerror

Fired when an error is reported by the remote client, and the connection is being closed.
Parameters:
Name Type Description
status Guacamole.Status A status object which describes the error.
Source:

onfile

Fired when a file stream is created. The stream provided to this event handler will contain its own event handlers for received data.
Parameters:
Name Type Description
stream Guacamole.InputStream The stream that will receive data from the server.
mimetype String The mimetype of the file received.
filename String The name of the file received.
Source:

onfilesystem

Fired when a filesystem object is created. The object provided to this event handler will contain its own event handlers and functions for requesting and handling data.
Parameters:
Name Type Description
object Guacamole.Object The created filesystem object.
name String The name of the filesystem.
Source:

onname

Fired when the remote client sends a name update.
Parameters:
Name Type Description
name String The new name of this client.
Source:

onpipe

Fired when a pipe stream is created. The stream provided to this event handler will contain its own event handlers for received data;
Parameters:
Name Type Description
stream Guacamole.InputStream The stream that will receive data from the server.
mimetype String The mimetype of the data which will be received.
name String The name of the pipe.
Source:

onstatechange

Fired whenever the state of this Guacamole.Client changes.
Parameters:
Name Type Description
state Number The new state of the client.
Source:

onsync

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:
Name Type Description
timestamp Number The timestamp associated with the sync instruction.
Source:

onvideo

Fired when a video stream is created. The stream provided to this event handler will contain its own event handlers for received data.
Parameters:
Name Type Description
stream Guacamole.InputStream The stream that will receive video data from the server.
layer Guacamole.Display.VisibleLayer The destination layer on which the received video data should be played. It is the responsibility of the Guacamole.VideoPlayer implementation to play the received data within this layer.
mimetype String The mimetype of the video data which will be received.
Source:
Returns:
An object which implements the Guacamole.VideoPlayer interface and has been initialied to play the data in the provided stream, or null if the built-in video players of the Guacamole client should be used.
Type
Guacamole.VideoPlayer