Re: Not set width and height,Not auto suite my screen.

2019-03-13 Thread Mike Jumper
On Wed, Mar 13, 2019 at 7:37 PM 若鸟  wrote:

>   My English is so bad,you may find it difficult to read.
>   I coding with guacamole-ext and  implement the example servlet from the
> official manual.I am not set width and height but the dispaly form browser
> don't auto suite my screen.
>

As far as RDP is concerned, there are three sets of dimensions involved:

1) The "width" and "height" connection parameters. These values explicitly
set the width and height in pixels. They are raw parameters without any
implications about what these dimensions mean for the client.
2) The client's requested/desired/optimal width and height. These are part
of the connection handshake and are used by the RDP implementation if
"width" and "height" aren't given. The protocol implementation is allowed
to adjust these values.
3) The dimensions of the client display in the browser. Unless you set
otherwise through a call to scale(), the size of the client display will
exactly match the remote display, with the remote display being set as
described in #1 and #2 above.

If you want your custom application to scale the display automatically, you
will need to:

1) Forward the relevant dimensions to your tunnel implementation so that it
can forward them to guacd during the connection handshake (using an
instance of GuacamoleClientInformation):

http://guacamole.apache.org/doc/guacamole-common/org/apache/guacamole/protocol/GuacamoleClientInformation.html#setOptimalScreenWidth-int-
http://guacamole.apache.org/doc/guacamole-common/org/apache/guacamole/protocol/GuacamoleClientInformation.html#setOptimalScreenHeight-int-
http://guacamole.apache.org/doc/guacamole-common/org/apache/guacamole/protocol/ConfiguredGuacamoleSocket.html#ConfiguredGuacamoleSocket-org.apache.guacamole.net.GuacamoleSocket-org.apache.guacamole.protocol.GuacamoleConfiguration-org.apache.guacamole.protocol.GuacamoleClientInformation-

2) When the display changes size on the client side (the "onresize" event)
and when the browser is resized, recalculate the necessary scale and set it
explicitly through a call to scale():

http://guacamole.apache.org/doc/guacamole-common-js/Guacamole.Display.html#event:onresize
http://guacamole.apache.org/doc/guacamole-common-js/Guacamole.Display.html#scale

- Mike


Not set width and height,Not auto suite my screen.

2019-03-13 Thread ????
My English is so bad,you may find it difficult to read.

  I coding with guacamole-ext and  implement the example servlet from the 
official manual.I am not set width and height but the dispaly form browser 
don't auto suite my screen.Would you help me? thank you very much,very much.

  I searched on baidu and google , but  didn't find solution,so send email for 
you, I am sorry to disturb you with such a small problem.


Chinese version :

??guacamole-ext 
??Demo width??height 
,??width ??height 
???
,google??

Re: Guacamole Prompting, Round 4,963,211

2019-03-13 Thread Nick Couchman
>
> >
> Looks reasonable. Naming convention within libguac for the various
> instruction sending functions is guac_protocol_send_OPCODE(), though, so
> this would need to be guac_protocol_send_required().
>

I've updated the naming conventions on these...


>
> Perhaps the instruction should accept a list of parameter names rather than
> just a single name? This is what is done for the related "args"
> instruction:
>
> https://guacamole.apache.org/doc/1.0.0/libguac/protocol_8h.html#a6047d380b097ebc7d5f35b167e3419e6
>
>
Yeah, this was my next step, but just thought I should start with getting
it working, then move on to making the code more efficient.


> Client:
> >
> >
> https://github.com/necouchman/guacamole-client/commit/72de5595880baea46505cf4f9ad49640f16519e7
>
>
> Same here - convention is "onOPCODE", so this would need to be
> "onrequired".
>

Fixed.


> >
> I think you will run into trouble manually parsing the Guacamole protocol
> with a guac_parser in a context where inbound instructions are already
> being parsed received. Is this because the FreeRDP authentication callback
> must be synchronous?
>
>
I'm not sure.  On the xfreerdp side of things, this code results in a
Password: prompt on the command line, and the xfreerdp app waits until you
enter something before proceeding.

The piece that sends back the requests for information to the client
appears to be working, it's the whole stopping and waiting piece that isn't
quite there.  In particular, with my debugging code, on the client-side I
get the following message:

>>>PROMPT<<< Selected the following field: {
  "name": "username",
  "type": "USERNAME"
}

So, it's seeing the need for a username and sending it back to the client.
Unfortunately, for whatever reason, it doesn't actually wait for the client
to respond - I just immediately get the message:

> The remote desktop server is currently unreachable. If the problem
persists, please notify your system administrator, or check your system
logs.

with the reconnect in 15 seconds dialog, and the option to go home, etc.


> Things will need to be changed to allow normal handling of received
> instructions, with the response to your prompt being received via two argv
> streams, handled with user->argv_handler, etc. This may already be doable
> if the FreeRDP aspects of the connection are in a separate thread (I think
> they are), as this function could (1) send the request for credentials and
> (2) block on a pthread conditional waiting for those credentials to be
> received.
>

Ah, okay, is there anything special to do to block the pthread?


>
> What error are you seeing specifically?
>
>
On the client-side I get the message I posted above - the server is
unreachable, reconnecting, etc.  On the server-side, I get the following:

Mar 13 13:15:16 guachost1 guacd[51397]: User
"@75e645b0-6d05-454d-bbdc-e95a772009b6" joined connection
"$93d136f6-c210-443f-aa78-2fd1b92a9832" (1 users now present)
Mar 13 13:15:16 guachost1 guacd[51397]: Loading keymap "base"
Mar 13 13:15:16 guachost1 guacd[51397]: Loading keymap "en-us-qwerty"
Mar 13 13:15:16 guachost1 guacd[51397]: Unable to get username from client.
Mar 13 13:15:16 guachost1 guacd[51397]: Error connecting to RDP server
Mar 13 13:15:16 guachost1 guacd[51397]: User
"@75e645b0-6d05-454d-bbdc-e95a772009b6" disconnected (0 users remain)
Mar 13 13:15:16 guachost1 guacd[51397]: Last user of connection
"$93d136f6-c210-443f-aa78-2fd1b92a9832" disconnected
Mar 13 13:15:16 guachost1 guacd[51397]: Requesting termination of client...
Mar 13 13:15:16 guachost1 guacd[51397]: Client terminated successfully.
Mar 13 13:15:16 guachost1 guacd[46005]: Connection
"$93d136f6-c210-443f-aa78-2fd1b92a9832" removed.

So, you're probably right - it's probably either not blocking, or the other
protocol messages going back-and-forth during this time are triggering it
to continue, and it continues not having received the information it was
expecting??

-Nick