Categorygithub.com/wwt/guac
modulepackage
1.3.2
Repository: https://github.com/wwt/guac.git
Documentation: pkg.go.dev

# README

guac

A port of the Apache Guacamole client to Go.

Apache Guacamole provides access to your desktop using remote desktop protocols in your web browser without any plugins.

GoDoc Go Report Card Build Status

Development

First start guacd in a container, for example:

docker run --name guacd -d -p 4822:4822 guacamole/guacd

Next run the example main:

go run cmd/guac/guac.go

Now you can connect with the example Vue app. By default, guac will try to connect to a guacd instance at 127.0.0.1:4822. If you need to configure something different, you can do so by configuring environment variables; see the configurable parameters below.

Guac listens on http://0.0.0.0:4567. If you have a need for the connection to Guac to be secure, you will need to pass a certificate and keyfile to it using the CERT_PATH and CERT_KEY_PATH environment variables; it will then listen on https://0.0.0.0:4567. The secure connection uses TLS 1.3.

Configurable parameters

Environment VariableDescriptionDefault ValueRequired?
CERT_PATHFull path, including filename, to a certificate file in order for guac to listen on HTTPS (TLS 1.3)No
CERT_KEY_PATHFull path, including filename, to the certificate keyfile in order for guac to listen on HTTPS (TLS 1.3)No
GUACD_ADDRESSThe address and port that guacd is listening on127.0.0.1:4822No

Acknowledgements

Initially forked from https://github.com/johnzhd/guacamole_client_go which is a direct rewrite of the Java Guacamole client. This project no longer resembles that one but it helped it get off the ground!

Some of the comments are taken directly from the official Apache Guacamole Java client.

# Packages

No description provided by the author

# Functions

FromGuacamoleStatusCode returns the Status corresponding to the given Guacamole protocol Status code.
NewGuacamoleConfiguration returns a Config with sane defaults.
NewInstruction creates an instruction.
No description provided by the author
NewMemorySessionStore creates a new store.
NewServer constructor.
NewSimpleTunnel creates a new tunnel.
NewStream creates a new stream.
NewTunnelMap creates a new TunnelMap and starts the scheduled job with the default timeout.
NewWebsocketServer creates a new server with a simple connect method.
NewWebsocketServerWs creates a new server with a connect method that takes a websocket.
No description provided by the author
ReadOne takes an instruction from the stream and parses it into an Instruction.

# Constants

ClientBadRequest indicates the operation could not be performed because bad parameters were given.
ClientBadType indicates the client sent data of an unsupported or unexpected type.
ClientForbidden indicates the user is not allowed to do the operation.
ClientOverrun indicates the client sent too much data.
ClientTimeout indicates the client took too long to respond.
ClientTooMany indivates the operation failed because the current client is already using too many resources.
ClientUnauthorized indicates the user is not authorized.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
The Guacamole protocol instruction Opcode reserved for arbitrary internal use by tunnel implementations.
TODO is this bytes or runes?.
ResourceClosed indicates the operation could not be performed as the requested resource is now closed.
ResourceConflict indicates the operation could not be performed as the requested resource is already in use.
ResourceNotFound indicates the operation could not be performed as the requested resource does not exist.
ServerBusy indicates the operation could not be performed as the server is busy.
ServerError indicates the operation could not be performed due to an internal failure.
SessionClosed indicates the session within the upstream server has been forcibly terminated.
SessionConflict indicates the session within the upstream server has ended because it conflicted with another session.
SessionTimeout indicates the session within the upstream server has ended because it appeared to be inactive.
No description provided by the author
Success indicates the operation succeeded.
TunnelTimeout is the number of seconds to wait between tunnel accesses before timing out.
Undefined Add to instead null.
Unsupported indicates the requested operation is unsupported.
UpstreamError indicates the operation was unsuccessful due to an error or otherwise unexpected condition of the upstream server.
UpstreamNotFound indicates the operation could not be performed because the upstream server does not appear to exist.
UpstreamTimeout indicates the operation could not be performed because the upstream server is not responding.
UpstreamUnavailable indicates the operation could not be performed because the upstream server is not available to service the request.

# Structs

Config is the data sent to guacd to configure the session during the handshake.
CountedLock counts how many goroutines are waiting on the lock.
No description provided by the author
Instruction represents a Guacamole instruction.
LastAccessedTunnel tracks the last time a particular Tunnel was accessed.
MemorySessionStore is a simple in-memory store of connected sessions that is used by the WebsocketServer to store active sessions.
Server uses HTTP requests to talk to guacd (as opposed to WebSockets in ws_server.go).
Base Tunnel implementation which synchronizes access to the underlying reader and writer with locks.
Stream wraps the connection to Guacamole providing timeouts and reading a single instruction at a time (since returning partial instructions would be an error).
TunnelMap tracks in-use HTTP tunnels, automatically removing and closing tunnels which have not been used recently.
WebsocketServer implements a websocket-based connection to guacd.

# Interfaces

InstructionReader provides reading functionality to a Stream.
MessageReader wraps a websocket connection and only permits Reading.
MessageWriter wraps a websocket connection and only permits Writing.
Tunnel provides a unique identifier and synchronized access to the InstructionReader and Writer associated with a Stream.

# Type aliases

No description provided by the author
No description provided by the author