Ah, ok. I did not do the following from the Guac server:
$ ./guacctl -o "test-pipe"; echo -n "hello world"; ./guacctl -c I thought the pipe would be available as part of the SSH or Telnet connection being established and the text coming from the connected device would be available in the pipe. I was hoping to access the text data at the javascript level. -Jeff From: Mike Jumper <[email protected]> Reply-To: "[email protected]" <[email protected]> Date: Wednesday, February 21, 2018 at 2:07 PM To: "[email protected]" <[email protected]> Subject: EXT: Re: Working with pipes 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/58537771afcbaa5619e11cdf3e6ad52aa9f6584d 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) <[email protected]> wrote: If the Guac server is opening a pipe stream and redirecting output to it, wouldn’t the onpipe event fire in the Guac client? guacClient.onpipe = function(input_stream, mimetype, name) { reader = new Guacamole.StringReader(input_stream); reader.ontext = function receiveText(text) { console.log(text); }; } -Jeff From: Mike Jumper <[email protected]> Reply-To: "[email protected]" <[email protected]> Date: Tuesday, February 20, 2018 at 9:33 PM To: "[email protected]" <[email protected]> Subject: EXT: Re: Working with pipes On Tue, Feb 20, 2018 at 7:23 PM, Nick Couchman <[email protected]> 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. So, doing anything with it (parsing, etc.) at the JavaScript layer is probably impractical, if not impossible. Waaaaaait! Guacamole does send images, yes, but there is also an OSC which 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
smime.p7s
Description: S/MIME cryptographic signature
