You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@guacamole.apache.org by Nikola Malešević <ni...@gmail.com> on 2016/11/01 09:25:28 UTC
Time-limiting connections
Hello,
I would like to time-limit each connection by a set of rules that are
contained in my local database. For instance, some sessions would be
limited to 30 minutes, some to 14, it depends from connection to connection.
I am not sure how I can kill the connection from server-side. I have
already developed an extension for authentication using Moodle log-in and
remote end-point connection data, but now I need to also close that same
connection after some period of time.
The best would be if there was something like
SimpleAuthenticationProvider (but for connection handling) that I could
extend to suit my needs.
Thanks for your advice.
Regards,
Nikola Malesevic
Re: Time-limiting connections
Posted by Mike Jumper <mi...@guac-dev.org>.
On Tue, Nov 1, 2016 at 2:25 AM, Nikola Malešević <nikola.malesevic@gmail.com
> wrote:
> Hello,
>
> I would like to time-limit each connection by a set of rules that are
> contained in my local database. For instance, some sessions would be
> limited to 30 minutes, some to 14, it depends from connection to connection.
>
> I am not sure how I can kill the connection from server-side. I have
> already developed an extension for authentication using Moodle log-in and
> remote end-point connection data, but now I need to also close that same
> connection after some period of time.
>
> The best would be if there was something like
> SimpleAuthenticationProvider (but for connection handling) that I could
> extend to suit my needs.
>
>
If you wish for your extension to close a connection, all it needs to do is
invoke the close() function on the associated GuacamoleTunnel. Each
Connection implementation is required to provide a connect() function which
returns a GuacamoleTunnel, so you can use that as a means of
extending/overriding the tunnel, automatically closing after some amount of
time has elapsed. The DelegatingGuacamoleTunnel class may be an easy way of
doing that, if you're already using the Simple* implementations.
I'd suggest having a single extension-wide structure containing all
currently-active connections, along with a monitoring thread which kicks in
every minute or so to close() connections which are too old, rather than
having a ton of per-connection threads, especially if you're OK with
limiting granularity to +/- 1 minute. We use a similar algorithm for
tracking and expiring the authentication tokens associated with user
sessions within the Guacamole webapp.
Thanks,
- Mike
Re: Time-limiting connections
Posted by David Landry <da...@dmwl.net>.
I might not be the best person to respond, but I don't think there's an
entry point like you're describing. If you used guacamole-common to build
your own web app, that might be something you could do.
What sort of connection protocols are you using? If it's RDP, you should be
able to configure session time limits on the RDP host [0]. If you're
handling SSH or VNC connections, I don't know of any built in option, but
you could likely put together a script that would kill sessions after a
certain amount of time.
[0] https://technet.microsoft.com/en-us/library/ee791741(v=ws.10).aspx
On Tue, Nov 1, 2016 at 5:25 AM Nikola Malešević <ni...@gmail.com>
wrote:
> Hello,
>
> I would like to time-limit each connection by a set of rules that are
> contained in my local database. For instance, some sessions would be
> limited to 30 minutes, some to 14, it depends from connection to connection.
>
> I am not sure how I can kill the connection from server-side. I have
> already developed an extension for authentication using Moodle log-in and
> remote end-point connection data, but now I need to also close that same
> connection after some period of time.
>
> The best would be if there was something like
> SimpleAuthenticationProvider (but for connection handling) that I could
> extend to suit my needs.
>
> Thanks for your advice.
>
> Regards,
> Nikola Malesevic
>
--
---
David Landry