diff --git a/guacamole-common-js/src/main/webapp/modules/Client.js b/guacamole-common-js/src/main/webapp/modules/Client.js index 83d89abaa..d30075d4f 100644 --- a/guacamole-common-js/src/main/webapp/modules/Client.js +++ b/guacamole-common-js/src/main/webapp/modules/Client.js @@ -687,6 +687,17 @@ Guacamole.Client = function(tunnel) { * A status object which describes the error. */ this.onerror = null; + + /** + * Fired when a message is received from the remote tunnel and needs to be + * displayed to the user. + * + * @event + * @param {String} message + * The message sent by the remote end of the tunnel that should be + * displayed for the user. + */ + this.onmsg = null; /** * Fired when a audio stream is created. The stream provided to this event @@ -1399,6 +1410,12 @@ Guacamole.Client = function(tunnel) { } }, + + "msg" : function(parameters) { + + if (guac_client.onmsg) guac_client.onmsg(parameters[0]); + + }, "name": function(parameters) { if (guac_client.onname) guac_client.onname(parameters[0]); diff --git a/guacamole-common/src/main/java/org/apache/guacamole/protocol/GuacamoleProtocolCapability.java b/guacamole-common/src/main/java/org/apache/guacamole/protocol/GuacamoleProtocolCapability.java index 5cad8a280..354bfc85d 100644 --- a/guacamole-common/src/main/java/org/apache/guacamole/protocol/GuacamoleProtocolCapability.java +++ b/guacamole-common/src/main/java/org/apache/guacamole/protocol/GuacamoleProtocolCapability.java @@ -33,6 +33,13 @@ public enum GuacamoleProtocolCapability { */ ARBITRARY_HANDSHAKE_ORDER(GuacamoleProtocolVersion.VERSION_1_1_0), + /** + * Support for the "msg" instruction. The "msg" instruction allows the + * server to send messages to the client. Support for this instruction was + * introduced in {@link GuacamoleProtocolVersion#VERSION_1_5_0}. + */ + MSG_INSTRUCTION(GuacamoleProtocolVersion.VERSION_1_5_0), + /** * Negotiation of Guacamole protocol version between client and server * during the protocol handshake. The ability to negotiate protocol diff --git a/guacamole-common/src/main/java/org/apache/guacamole/protocol/GuacamoleProtocolVersion.java b/guacamole-common/src/main/java/org/apache/guacamole/protocol/GuacamoleProtocolVersion.java index 3ceda3b1a..054334f65 100644 --- a/guacamole-common/src/main/java/org/apache/guacamole/protocol/GuacamoleProtocolVersion.java +++ b/guacamole-common/src/main/java/org/apache/guacamole/protocol/GuacamoleProtocolVersion.java @@ -53,11 +53,18 @@ public class GuacamoleProtocolVersion { */ public static final GuacamoleProtocolVersion VERSION_1_3_0 = new GuacamoleProtocolVersion(1, 3, 0); + /** + * Protocol version 1.5.0, which introduces the "msg" instruction, allowing + * the server to send message notifications that will be displayed on the + * client. + */ + public static final GuacamoleProtocolVersion VERSION_1_5_0 = new GuacamoleProtocolVersion(1, 5, 0); + /** * The most recent version of the Guacamole protocol at the time this * version of GuacamoleProtocolVersion was built. */ - public static final GuacamoleProtocolVersion LATEST = VERSION_1_3_0; + public static final GuacamoleProtocolVersion LATEST = VERSION_1_5_0; /** * A regular expression that matches the VERSION_X_Y_Z pattern, where