I see that guacamole-client uses ‘ManagedClient.sendArguments’ but 
sendArguments’ needs to receive ManagedClient so I’m not sure how to use it in 
my code.

Get Outlook for Mac <https://aka.ms/GetOutlookForMac>

From: Nick Couchman <vn...@apache.org>
Date: Wednesday, 26 March 2025 at 12:05
To: user@guacamole.apache.org <user@guacamole.apache.org>
Subject: Re: Guacamole client .onrequired
On Wed, Mar 26, 2025 at 4:07 AM Gal Sabas <gal...@checkpoint.com.invalid> wrote:
Hi,

I have my own web-client that is based on guacamole-client.
I’m trying to add support to the “required” request for parameter prompting, I 
added this code to my client:

let client = new Guacamole.Client(tunnel)
client.onrequired = function(params) {
…
client.send(credentials);
}

For some reason, no matter what I send through the credentials, guacd don’t 
seem to accept them. Do I need to disconnect from the client and then connect 
again with the credentials?
Can someone please help me and maybe provide an example for and .onrequired?


The official Guacamole Client code uses this:

https://github.com/apache/guacamole-client/blob/78e0436dc202673686dc8a7741eca6cb21513d77/guacamole/src/main/frontend/src/app/client/types/ManagedClient.js#L720-L728<https://protect.checkpoint.com/v2/r02/___https:/github.com/apache/guacamole-client/blob/78e0436dc202673686dc8a7741eca6cb21513d77/guacamole/src/main/frontend/src/app/client/types/ManagedClient.js%23L720-L728___.YzJlOmNwYWxsOmM6bzo1M2RhZWQyNTY1NWNiZDZkMzc3ZjBjNjc4Y2M1MjkxYzo3OmIzMzI6MzA2YTM4YjUxNjhhNDhlNjU5MTc4MWQ4YTlhYWM3OTY4ZjVjZjZmNTVhNzI0NjcxYThjNTU2YjRmNTQ2MDUyNjpoOlQ6Tg>

I'd highly suggest going through the Guacamole Client code, particularly for 
the AngularJS front-end, to see how it is handled in there - this block only 
takes care of letting the client know that a required instruction has been sent 
and prompting the user - you have to go to a couple of other places to see 
where the user is actually prompted and where those responses are actually sent 
back to guacd.

And to answer your question, no, there is no need to disconnect and reconnect - 
in the cases where guacd sends the "required" instruction, it is usually 
because there is a call-back function from one of the supported protocols being 
invoked that needs more information and is now waiting on that information to 
be provided.

I know that's a very high-level answer - feel free to post back with more 
specific/detailed questions.

-Nick

Reply via email to