I am trying to instantiate client for guacamole in the example here

// Instantiate client, using an HTTP tunnel for communications.
            var guac = new Guacamole.Client(
                new Guacamole.HTTPTunnel("tunnel")
            );

This is from the example here https://guacamole.incubator.apache.org/doc/gug/writing-you-own-guacamole-app.html

Can I possibly do this if/when I have the servlet (tunnel) on a different host that the html file?

1

There are 1 answers

0
Mike Jumper On BEST ANSWER

Yes, you can connect to a Guacamole HTTP tunnel hosted on a different domain. You will need to specify the full URL to the tunnel (rather than the relative URL "tunnel"), as well as the optional crossDomain parameter when creating the Guacamole.HTTPTunnel:

http://guacamole.incubator.apache.org/doc/guacamole-common-js/Guacamole.HTTPTunnel.html

For example:

// Instantiate client, using an HTTP tunnel for communications.
var guac = new Guacamole.Client(
    new Guacamole.HTTPTunnel("https://full/url/to/tunnel", true)
);

Using Guacamole's WebSocket tunnel is also an option, as cross-origin restrictions do not apply there.