You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@guacamole.apache.org by Pierre Bastola <ba...@gmail.com> on 2023/11/30 22:02:21 UTC

Copy and paste with a Websocket-enabled application

Hi there,

I am creating an application that uses the Websockets to render a remote
desktop on the browser using Guacamole. The rdp server is XRDP.
I wanted to know how users can copy and paste into and out of the screen on
the browser.

Any help would be appreciated!!!

Best,
*Pierre*
*Phone: (341)-204-7713*
*Email: bastola.pierre@gmail.com <ba...@gmail.com>*

Re: Copy and paste with a Websocket-enabled application

Posted by Pierre Bastola <ba...@gmail.com>.
Thanks Michael. Appreciate it!

On Thu, Nov 30, 2023 at 5:03 PM Michael Jumper <mj...@apache.org> wrote:

> On 11/30/2023 2:02 PM, Pierre Bastola wrote:
> > Hi there,
> >
> > I am creating an application that uses the Websockets to render a remote
> > desktop on the browser using Guacamole. The rdp server is XRDP.
> > I wanted to know how users can copy and paste into and out of the screen
> > on the browser.
> >
>
> The underlying transport (WebSocket) has no bearing on how clipboard
> contents are sent/received over Guacamole.
>
> To send clipboard contents, you create a clipboard stream and write the
> clipboard contents to that stream:
>
>
> https://guacamole.apache.org/doc/guacamole-common-js/Guacamole.Client.html#createClipboardStream
>
> This is typically done using one of the writer objects that wrap
> streams, such as Guacamole.StringWriter:
>
>
> https://guacamole.apache.org/doc/guacamole-common-js/Guacamole.StringWriter.html
>
> Clipboard contents received from the remote desktop are received as
> clipboard streams via the "onclipboard" event:
>
>
> https://guacamole.apache.org/doc/guacamole-common-js/Guacamole.Client.html#event:onclipboard
>
> The inbound stream is typically decoded as a more useful object using
> one of the reader objects that wrap streams, such as
> Guacamole.StringReader:
>
>
> https://guacamole.apache.org/doc/guacamole-common-js/Guacamole.StringReader.html
>
> If you want to interact with the local clipboard, updating the remote
> clipboard when the local clipboard changes and updating the local
> clipboard when the remote clipboard changes, you can do that for
> browsers that support it, but the core Guacamole libraries do not assume
> that this is appropriate (nor that any particular approach to doing this
> will work across the board) and will not do this for you.
>
> - Mike
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@guacamole.apache.org
> For additional commands, e-mail: user-help@guacamole.apache.org
>
>

-- 
*Pierre*
*Phone: (341)-204-7713*
*Email: bastola.pierre@gmail.com <ba...@gmail.com>*

Re: Copy and paste with a Websocket-enabled application

Posted by Michael Jumper <mj...@apache.org>.
On 11/30/2023 2:02 PM, Pierre Bastola wrote:
> Hi there,
> 
> I am creating an application that uses the Websockets to render a remote 
> desktop on the browser using Guacamole. The rdp server is XRDP.
> I wanted to know how users can copy and paste into and out of the screen 
> on the browser.
> 

The underlying transport (WebSocket) has no bearing on how clipboard 
contents are sent/received over Guacamole.

To send clipboard contents, you create a clipboard stream and write the 
clipboard contents to that stream:

https://guacamole.apache.org/doc/guacamole-common-js/Guacamole.Client.html#createClipboardStream

This is typically done using one of the writer objects that wrap 
streams, such as Guacamole.StringWriter:

https://guacamole.apache.org/doc/guacamole-common-js/Guacamole.StringWriter.html

Clipboard contents received from the remote desktop are received as 
clipboard streams via the "onclipboard" event:

https://guacamole.apache.org/doc/guacamole-common-js/Guacamole.Client.html#event:onclipboard

The inbound stream is typically decoded as a more useful object using 
one of the reader objects that wrap streams, such as Guacamole.StringReader:

https://guacamole.apache.org/doc/guacamole-common-js/Guacamole.StringReader.html

If you want to interact with the local clipboard, updating the remote 
clipboard when the local clipboard changes and updating the local 
clipboard when the remote clipboard changes, you can do that for 
browsers that support it, but the core Guacamole libraries do not assume 
that this is appropriate (nor that any particular approach to doing this 
will work across the board) and will not do this for you.

- Mike

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