From user-return-3316-archive-asf-public=cust-asf.ponee.io@guacamole.apache.org Wed Feb 21 21:08:12 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 1662318061A for ; Wed, 21 Feb 2018 21:08:11 +0100 (CET) Received: (qmail 41764 invoked by uid 500); 21 Feb 2018 20:08:11 -0000 Mailing-List: contact user-help@guacamole.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@guacamole.apache.org Delivered-To: mailing list user@guacamole.apache.org Received: (qmail 41754 invoked by uid 99); 21 Feb 2018 20:08:11 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 Feb 2018 20:08:11 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 8FA3F1A0A2E for ; Wed, 21 Feb 2018 20:08:10 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.229 X-Spam-Level: ** X-Spam-Status: No, score=2.229 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=2, KAM_LOTSOFHASH=0.25, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=guac-dev-org.20150623.gappssmtp.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id 8d1048D9ijLj for ; Wed, 21 Feb 2018 20:08:08 +0000 (UTC) Received: from mail-qk0-f178.google.com (mail-qk0-f178.google.com [209.85.220.178]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 53F085F3CD for ; Wed, 21 Feb 2018 20:08:08 +0000 (UTC) Received: by mail-qk0-f178.google.com with SMTP id h129so3610075qke.8 for ; Wed, 21 Feb 2018 12:08:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=guac-dev-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=Ry0qkjcS6lUR2A2LMo1kJYDxh18CcEyM14m1hOsftec=; b=SpPPwvTdbAW1EH3AJQgX7MG+MI3VGvuXrdb+JWZsJ/DOTAIj4E5YZgumaGy4Q8a1fL kKx/bL2fFrveV6nEehJ1W397oMzZ3/PVyXedU5Qu0JhBNUfYAnzob4QkjCSxGohdj225 cRJWX5vv5Ff2FrxrW8JZCVbXdB78rGe7iGnwvF6cF9f+4aIj4EiKbHOG661JrKDGaRZ+ Qe0u+n0OAbkSYnC3R5TQfoyzEPdXq8oVWrGmX9m8rWv2pR7tWxOmNnJFUTecC+dVWdFu gTnNqyCpA+EjSCjieoNnpamz15W76BaaSRmbxS7dE63cWgvT/rCAP0a/GflDo1qUKKqt 25/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=Ry0qkjcS6lUR2A2LMo1kJYDxh18CcEyM14m1hOsftec=; b=twPoMI6QHDAYorwx2kPy1oT/bB8jP71wiXPstUfKcpQHP6TnGoFFhayIUW7rq0YVXU OHBEA3xPCAOEsJf4sINH7PM5YC9Un+JXicAHMglWOv30cCCkeBsyHhDH/Frl3aIUhc5Y Lc7GdA0+QGj7LDmLk+zrj8pECt18OaVRAhtA+Eb7HLxPWZtfbIcQ4F81fQ3PL4ubVulv DIwCRQ6M8ZAMaQCfFLTPpao4RHteIDPkSOzhGtMNt0dHq0/t/6gjWaBHN7Zyq1U8W90T lIBQGHhz6H9wKKDuYQi4lSeaMa3x7NVsmxumSXnIeXeMR4EdZlG71l00cZCsNhlig764 D9fA== X-Gm-Message-State: APf1xPClMOhIzu2a5v6Hlv/RCkiuKuT+NUwLwE6stkTYfmTrYjYvcfxi lUgwNqBKM/q+RMOK3i0+jqstS6z0ev496LDB18tWuai8 X-Google-Smtp-Source: AH8x226jvLwkFbMQBKhl0jG9WxqIO1n+ka7d6nIDyV3xn3tz4lqQGvo9mH8C72yWgJ9RjcK/X7OzEgh8oNgAXlYWh1w= X-Received: by 10.55.101.146 with SMTP id z140mr7038715qkb.178.1519243682322; Wed, 21 Feb 2018 12:08:02 -0800 (PST) MIME-Version: 1.0 Received: by 10.237.63.161 with HTTP; Wed, 21 Feb 2018 12:07:21 -0800 (PST) X-Originating-IP: [73.15.226.52] In-Reply-To: <5135C164-F33A-4879-956E-DE8F896635B9@ge.com> References: <5135C164-F33A-4879-956E-DE8F896635B9@ge.com> From: Mike Jumper Date: Wed, 21 Feb 2018 12:07:21 -0800 Message-ID: Subject: Re: Working with pipes To: user@guacamole.apache.org Content-Type: multipart/alternative; boundary="001a114da79003329c0565be7c43" --001a114da79003329c0565be7c43 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Yes, onpipe should be firing for pipe streams created in this way. To demonstrate general usage and expectations here, I've created a quick topic branch to act as a temporary POC which adds handling for "text/plain" pipe streams, logging their creation, closure, and any data received along the stream: https://github.com/mike-jumper/guacamole-client/commit/58537771afcbaa5619e1= 1cdf3e6ad52aa9f6584d After establishing an SSH connection via a Guacamole server having the above commit, I ran the following one-liner to open a new pipe stream called "test-pipe", print "hello world" while output is redirected to that pipe stream, and finally close the stream: $ ./guacctl -o "test-pipe"; echo -n "hello world"; ./guacctl -c The log within the browser displayed: pipe: test-pipe: stream begins pipe: test-pipe: "hello world" pipe: test-pipe: stream ends and withing guacd: ... guacd[3374]: DEBUG: Terminal output now redirected to pipe 'test-pipe'. guacd[3374]: DEBUG: Terminal output now redirected to display. ... - Mike On Wed, Feb 21, 2018 at 6:48 AM, McRoy, Jeffrey (GE Healthcare) < Jeffrey.McRoy@ge.com> wrote: > If the Guac server is opening a pipe stream and redirecting output to it, > wouldn=E2=80=99t the onpipe event fire in the Guac client? > > > > guacClient.onpipe =3D function(input_stream, mimetype, name) { > > reader =3D new Guacamole.StringReader(input_stream); > > reader.ontext =3D function receiveText(text) { > > console.log(text); > > }; > > } > > > > -Jeff > > > > > > *From: *Mike Jumper > *Reply-To: *"user@guacamole.apache.org" > *Date: *Tuesday, February 20, 2018 at 9:33 PM > *To: *"user@guacamole.apache.org" > *Subject: *EXT: Re: Working with pipes > > > > On Tue, Feb 20, 2018 at 7:23 PM, Nick Couchman wrote: > > Is it possible for the client to access the terminal output at either the > javascript or java layer? > > > > > > So, one thing to keep in mind, here, is that the terminal output from SSH > and Telnet is transmitted from guacd to the Guacamole Client as an image, > not as text. I know it doesn't *seem* like it, particularly since the > client allows you to select text and copy it to the clipboard (and > vice-versa), but if you look at the actual data going back and forth, all > of the screen output, include "text" from the terminal, is image data. S= o, > doing anything with it (parsing, etc.) at the JavaScript layer is probabl= y > impractical, if not impossible. > > > > Waaaaaait! Guacamole does send images, yes, but there is also an OSC whic= h > temporarily redirects output to a pipe stream: > > > > https://github.com/apache/guacamole-server/blob/ > 99e6f89eba56b6effc189d1c2c160686ed880beb/src/terminal/ > terminal_handlers.c#L1314-L1320 > > > > There is an example of this within guacctl: > > > > https://github.com/apache/guacamole-server/blob/ > 99e6f89eba56b6effc189d1c2c160686ed880beb/bin/guacctl#L285-L301 > > > > - Mike > > > --001a114da79003329c0565be7c43 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Yes, onpipe should be firing for pipe streams created in t= his way. To demonstrate general usage and expectations here, I've creat= ed a quick topic branch to act as a temporary POC which adds handling for &= quot;text/plain" pipe streams, logging their creation, closure, and an= y data received along the stream:


After esta= blishing an SSH connection via a Guacamole server having the above commit, = I ran the following one-liner to open a new pipe stream called "test-p= ipe", print "hello world" while output is redirected to that= pipe stream, and finally close the stream:

=C2=A0= =C2=A0 $=C2=A0./guacctl -o "test-pipe"; echo -n "hello worl= d"; ./guacctl -c

The log within the browser d= isplayed:

=C2=A0 =C2=A0 pipe: test-pipe: stre= am begins
=C2=A0 =C2=A0 pipe: test-pipe: "hello world"<= /div>
=C2=A0 =C2=A0 pipe: test-pipe: stream ends

and withing guacd:

=C2=A0 =C2=A0 ...
=C2=A0 =C2=A0 guacd[3374]: DEBUG: Terminal output now redirected to pipe 'test-pipe'.
<= div>=C2=A0 =C2=A0 guacd[3374]: DEBUG: Terminal output now redirected to display.
=C2=A0 =C2=A0 = ...

- Mike


On Wed, Feb 21, 2018 at 6:48 A= M, McRoy, Jeffrey (GE Healthcare) <Jeffrey.McRoy@ge.com> = wrote:

If the Guac server is opening a pipe stream and redirecting = output to it, wouldn=E2=80=99t the onpipe event fire in the Guac client?=

=C2=A0=

guacClient.onpipe = =3D function(input_stream, mimetype, name) {

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 reader =3D new= Guacamole.StringReader(input_stream);

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 reader.ontext = =3D function receiveText(text) {

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 = console.log(text);

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 };

}

=C2=A0

-Jeff<= u>

=C2=A0

=C2=A0

From: Mike Jumper <mike.jumper@guac-dev.org>
Reply-= To: "user@guacamole.apache.org" <user@guacamole.apache.org>
Date:= Tuesday, February 20, 2018 at 9:33 PM
To: &= quot;user@gu= acamole.apache.org" <user@guacamole.apache.org>
Subject: E= XT: Re: Working with pipes

=C2=A0

On Tue, Feb 2= 0, 2018 at 7:23 PM, Nick Couchman <vnick@apache.org&g= t; wrote:

Is it possible for the client to acc= ess the terminal output at either the javascript or java layer?

=C2=A0

=C2=A0

So,= one thing to keep in mind, here, is that the terminal output from SSH and = Telnet is transmitted from guacd to the Guacamole Client as an image, not a= s text.=C2=A0 I know it doesn't *seem* like it, particularly since the = client allows you to select text and copy it to the clipboard (and vice-ver= sa), but if you look at the actual data going back and forth, all of the sc= reen output, include "text" from the terminal, is image data.=C2= =A0 So, doing anything with it (parsing, etc.) at the JavaScript layer is p= robably impractical, if not impossible.

=C2=A0

Waaaaaait! G= uacamole does send images, yes, but there is also an OSC which temporarily = redirects output to a pipe stream:

=C2=A0

=C2=A0

There is an example of this within guacctl:

=C2=A0<= /p>

=C2=A0<= /p>

- Mike

<= /div>

=C2=A0


--001a114da79003329c0565be7c43--