From 2085ee7424648cde0bfcdbcda7b507cd1ce9c0dc Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Tue, 30 Jul 2019 13:02:01 -0700 Subject: [PATCH] GUACAMOLE-629: Allow client to receive connection parameter values via "argv" streams. --- .../src/main/webapp/modules/Client.js | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/guacamole-common-js/src/main/webapp/modules/Client.js b/guacamole-common-js/src/main/webapp/modules/Client.js index e947b7030..07baf7731 100644 --- a/guacamole-common-js/src/main/webapp/modules/Client.js +++ b/guacamole-common-js/src/main/webapp/modules/Client.js @@ -649,6 +649,23 @@ Guacamole.Client = function(tunnel) { */ this.onvideo = null; + /** + * Fired when the current value of a connection parameter is being exposed + * by the server. + * + * @event + * @param {Guacamole.InputStream} stream + * The stream that will receive connection parameter data from the + * server. + * + * @param {String} mimetype + * The mimetype of the data which will be received. + * + * @param {String} name + * The name of the connection parameter whose value is being exposed. + */ + this.onargv = null; + /** * Fired when the clipboard of the remote client is changing. * @@ -846,6 +863,24 @@ Guacamole.Client = function(tunnel) { }, + "argv": function(parameters) { + + var stream_index = parseInt(parameters[0]); + var mimetype = parameters[1]; + var name = parameters[2]; + + // Create stream + if (guac_client.onargv) { + var stream = streams[stream_index] = new Guacamole.InputStream(guac_client, stream_index); + guac_client.onargv(stream, mimetype, name); + } + + // Otherwise, unsupported + else + guac_client.sendAck(stream_index, "Receiving argument values unsupported", 0x0100); + + }, + "audio": function(parameters) { var stream_index = parseInt(parameters[0]);