You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@guacamole.apache.org by fudg3 <am...@trustpeers.com> on 2020/01/27 17:26:50 UTC

Know when a session has been disconnected

Hey,
I am looking for a way for me to know (from the Java webserver) when a
session is disconnected (to update stuff on my other service's db)

How is that possible? Thanks a ton



--
Sent from: http://apache-guacamole-general-user-mailing-list.2363388.n4.nabble.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@guacamole.apache.org
For additional commands, e-mail: user-help@guacamole.apache.org


Re: Know when a session has been disconnected

Posted by Mike Jumper <mj...@apache.org>.
On Mon, Feb 10, 2020, 08:51 fudg3 <am...@trustpeers.com> wrote:

> Can anyone help with the last question? I couldn't think of a way to solve
> it.
>
> I can see when a tunnel is closed, but that does not mean that a different
> tunnel is still open to the same connection.
>
> Do i have an event where the connection itself is closed?
>


That's not how connections work. The flow of communication from client,
through the tunnel, to guacd, and finally to the remote desktop *is* the
connection. It doesn't matter at that level whether the configuration
parameters behind that parameter are the same. The object within the
extension API representing the details of a connection (prior to being
established) is indeed called Connection, but it is really just a
representation which allows the tunnel to be established. It doesn't get
closed. Only the tunnels it returns and the underlying sockets get closed.

If you wish to track the tunnels open for a particular set of parameters
such that you can conceptualize each of those open tunnels as logical
instances of a single connection, you will need to implement that tracking
using an appropriate data structure. This is what the database auth does,
for example, in order to track and enforce concurrent usage restrictions.

- Mike

Re: Know when a session has been disconnected

Posted by fudg3 <am...@trustpeers.com>.
Can anyone help with the last question? I couldn't think of a way to solve
it.

I can see when a tunnel is closed, but that does not mean that a different
tunnel is still open to the same connection. 

Do i have an event where the connection itself is closed?



--
Sent from: http://apache-guacamole-general-user-mailing-list.2363388.n4.nabble.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@guacamole.apache.org
For additional commands, e-mail: user-help@guacamole.apache.org


Re: Know when a session has been disconnected

Posted by fudg3 <am...@trustpeers.com>.
Bump :)



--
Sent from: http://apache-guacamole-general-user-mailing-list.2363388.n4.nabble.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@guacamole.apache.org
For additional commands, e-mail: user-help@guacamole.apache.org


Re: Know when a session has been disconnected

Posted by fudg3 <am...@trustpeers.com>.
Assuming i do not use guacamole-ext, how would you start going about
implementing this?




--
Sent from: http://apache-guacamole-general-user-mailing-list.2363388.n4.nabble.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@guacamole.apache.org
For additional commands, e-mail: user-help@guacamole.apache.org


Re: Know when a session has been disconnected

Posted by Nick Couchman <vn...@apache.org>.
On Tue, Jan 28, 2020 at 2:10 AM fudg3 <am...@trustpeers.com> wrote:

> Looks great, thanks for the answer.
>
> Can i use it if i have my own implementation of a Java webserver (not the
> one on github)?
>
>
Only if you're using the guacamole-ext part of the code - if you're writing
completely custom code then you'll have to also write code to detect the
disconnect events and handle them appropriately.

-Nick

Re: Know when a session has been disconnected

Posted by fudg3 <am...@trustpeers.com>.
Looks great, thanks for the answer.

Can i use it if i have my own implementation of a Java webserver (not the
one on github)?



--
Sent from: http://apache-guacamole-general-user-mailing-list.2363388.n4.nabble.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@guacamole.apache.org
For additional commands, e-mail: user-help@guacamole.apache.org


Re: Know when a session has been disconnected

Posted by Nick Couchman <vn...@apache.org>.
On Mon, Jan 27, 2020 at 12:23 PM fudg3 <am...@trustpeers.com> wrote:

> Hey,
> I am looking for a way for me to know (from the Java webserver) when a
> session is disconnected (to update stuff on my other service's db)
>
> How is that possible? Thanks a ton
>
>
There are a couple of ways you could do this, depending on what you really
need to do.  The easiest way in my mind would be to implement an event
listener extension that handles the TunnelCloseEvent:

http://guacamole.apache.org/doc/gug/event-listeners.html
https://github.com/apache/guacamole-client/blob/master/guacamole-ext/src/main/java/org/apache/guacamole/net/event/TunnelCloseEvent.java

Aside from that, you could also implement a custom authentication extension
that decorates another module and overrides the required methods for a
connection to detect and handle the event closure.  This would be a little
more involved, but gives you more flexibility in what data you have access
to and what you can do within Guacamole when things disconnect.

-Nick