Understood, thanks Nick for your reply. Will look through the code once. Just wanted to clarify once, client->join_handler is invoked once for a connection, for example, when a new rdp connection starts then we add users to that client that are joining that connection using user->join_handler
Once all users leave (user->leave_handler) from that connection/client, client->leave_handler is invoked and that finally terminates the connection. Is that correct? Just wanted your advice once, I'll modify what I require from those parameters in the protocol handler, but let's say once user logs in (i.e., client->join_handler), I want to call an API and once user logs out (i.e., client->leave_handler), I want to again make a POST call on an API. For this, I think it would be easier to write those API calls in another higher level language which I'll finally convert to an exe. So, is it advisable to communicate with that exe from the protocol handlers via IPC or can I adopt some other technique or shall I not write an exe and try to do that in C itself. Sorry, I think this question is diverging from Guacamole but just wanted suggestions for my use case. - Palaash On Fri, 13 Feb, 2026, 9:20 pm Nick Couchman, <[email protected]> wrote: > On Fri, Feb 13, 2026 at 7:12 AM Palaash Jain > <[email protected]> wrote: > > > > Hi, > > On the guacd level, I am detecting once a connection is closed or logged > off when we are towards the end of the thread. > > Basically, I have a custom daemon that creates a new thread for every > connection that has a single client and a single user for my use case, > > then that thread comes to end once it is done with > guac_user_handle_connection and then I conclude that the connection is > closing. // please refer below code > > > > But I want to perform extra activity here, once I know connection is > closed, I want to go and delete the redirected drive that the session had > used > > that I passed in my connection args, but I am not able to do so using > (guac_rdp_settings*)(user->data) as guac_rdp_settings is visible only for > rdp connections, not anyone outside. > > > > How can I get the values of those connection params so that I can > perform some actions later on after logging out? > > I guess these are sensitive params, that's why they are rightly hidden > by this approach but I want those values to pass to other exe. > > > > You'd have to either reference or store the protocol-level settings, > or at least copies of the ones you want access to, in such a way as to > allow you to access them after the protocol-level code has been > closed. > > But, more basically, why do you need to do this? Why not use the > protocol-level code to accomplish this and just modify that to do what > you want. The current guacd code already has extensive user join and > leave handlers, and add and remove user functions, several of which > are designed to be called within the protocol handler and that can > probably do what you're trying to do at the time that a user leaves a > connection: > > > https://github.com/apache/guacamole-server/blob/4577484c9e8fc1fdbc20e55d02da4696b7d301b1/src/libguac/guacamole/user.h#L418-L435 > > https://github.com/apache/guacamole-server/blob/4577484c9e8fc1fdbc20e55d02da4696b7d301b1/src/libguac/guacamole/client.h#L224-L245 > > https://github.com/apache/guacamole-server/blob/4577484c9e8fc1fdbc20e55d02da4696b7d301b1/src/libguac/guacamole/client.h#L263-L279 > > https://github.com/apache/guacamole-server/blob/4577484c9e8fc1fdbc20e55d02da4696b7d301b1/src/libguac/guacamole/client.h#L457-L478 > > https://github.com/apache/guacamole-server/blob/4577484c9e8fc1fdbc20e55d02da4696b7d301b1/src/protocols/rdp/user.c#L151-L166 > > Why not just work with those - or, if you're determined to write your > own version of guacd, look at the way those are implemented in the > official version of guacd and do something similar? > > -Nick > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >
