On Tue, Apr 24, 2018 at 1:51 AM, messido <mohammad.zba...@gmail.com> wrote:

> Mike Jumper wrote
> > Why are you manually invoking sendMessage()?
>
> Well i'm creating an interval to keep checking if connection is alive,
>

You do not need to do this. Ensuring keep-alive pings are sent during the
connection is an internal concern of Guacamole.Client, and the
Guacamole.Client already does this automatically. The snippet of code I
referenced earlier was not meant as a suggestion of what you need to do,
but rather to demonstrate that Guacamole.Client already takes this into
account, and that the cause of the timeout you're seeing must be something
else.

here's the code
>
> tunnel: any = new Guacamole.HTTPTunnel('tunnel');
>   guac: any  = new Guacamole.Client(this.tunnel);
>
> try {
>       this.tunnel.connect('tunnel');
>       console.log('connected tunnel');
>     }catch(err){
>       console.log('error connecting to tunnel', err)
>       throw err;
>     }
>

Please take a look at the tutorial in the manual, as well as the custom
webapp example included in the source:

http://guacamole.apache.org/doc/gug/writing-you-own-guacamole-app.html
https://github.com/apache/guacamole-client/tree/master/doc/guacamole-example

Though errors during connect were at one time handled synchronously, this
has not been the case since roughly 0.9.0 [1]. You will need to provide a
handler for "onerror" to programmatically deal with an error returned by
your server.

I would recommend looking into using the WebSocket tunnel, as well, at some
point (presumably chained behind the HTTPTunnel using ChainedTunnel), but
let's figure out what's wrong with your HTTP tunnel first.

Mike Jumper wrote
> > If your tunnel is returning HTTP 500, you will need to look at the
> > server-sode code of your tunnel implementation. Running it under a
> > debugger
> > may be in order.
> >
> > - Mike
>
> I'm reading the logs from guacd with DEBUG level on, nothing different is
> being thrown when calling "this.tunnel.connect(...);" vs when not calling
> it.. and the try/catch around "this.tunnel.connect" is not catching an
> error.. Should I be reading through trace or is there a better way to
> narrow
> down the issue on why tunnel.connect isn't working?
>

I'm referring here to your tunnel implementation (the class you've written
in your custom guac-powered webapp which extends
GuacamoleHTTPTunnelServlet). An HTTP 500 is returned by Tomcat, and thus by
the servlet handling the tunnel, not by guacd. If your web application is
returning an HTTP 500, you will need to debug your web application.

- Mike

[1]
https://github.com/apache/guacamole-client/commit/627271953d6eee6f49f4a385d8de62d6a0098be5

Reply via email to