mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-07 13:41:21 +00:00
Add width/height parameters to basic tunnel.
This commit is contained in:
@@ -27,18 +27,19 @@ import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import net.sourceforge.guacamole.GuacamoleException;
|
||||
import net.sourceforge.guacamole.GuacamoleSecurityException;
|
||||
import net.sourceforge.guacamole.net.InetGuacamoleSocket;
|
||||
import net.sourceforge.guacamole.protocol.GuacamoleConfiguration;
|
||||
import net.sourceforge.guacamole.properties.GuacamoleProperties;
|
||||
import net.sourceforge.guacamole.net.GuacamoleSocket;
|
||||
import net.sourceforge.guacamole.net.GuacamoleTunnel;
|
||||
import net.sourceforge.guacamole.net.InetGuacamoleSocket;
|
||||
import net.sourceforge.guacamole.net.auth.Credentials;
|
||||
import net.sourceforge.guacamole.net.basic.event.SessionListenerCollection;
|
||||
import net.sourceforge.guacamole.net.event.TunnelCloseEvent;
|
||||
import net.sourceforge.guacamole.net.event.TunnelConnectEvent;
|
||||
import net.sourceforge.guacamole.net.event.listener.TunnelCloseListener;
|
||||
import net.sourceforge.guacamole.net.event.listener.TunnelConnectListener;
|
||||
import net.sourceforge.guacamole.properties.GuacamoleProperties;
|
||||
import net.sourceforge.guacamole.protocol.ConfiguredGuacamoleSocket;
|
||||
import net.sourceforge.guacamole.protocol.GuacamoleClientInformation;
|
||||
import net.sourceforge.guacamole.protocol.GuacamoleConfiguration;
|
||||
import net.sourceforge.guacamole.servlet.GuacamoleHTTPTunnelServlet;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@@ -183,13 +184,26 @@ public class BasicGuacamoleTunnelServlet extends AuthenticatingHttpServlet {
|
||||
|
||||
logger.info("Successful connection from {} to \"{}\".", request.getRemoteAddr(), id);
|
||||
|
||||
// Get client information
|
||||
GuacamoleClientInformation info = new GuacamoleClientInformation();
|
||||
|
||||
// Set width if provided
|
||||
String width = request.getParameter("width");
|
||||
if (width != null)
|
||||
info.setOptimalScreenWidth(Integer.parseInt(width));
|
||||
|
||||
// Set height if provided
|
||||
String height = request.getParameter("height");
|
||||
if (height != null)
|
||||
info.setOptimalScreenHeight(Integer.parseInt(height));
|
||||
|
||||
// Configure and connect socket
|
||||
String hostname = GuacamoleProperties.getProperty(GuacamoleProperties.GUACD_HOSTNAME);
|
||||
int port = GuacamoleProperties.getProperty(GuacamoleProperties.GUACD_PORT);
|
||||
|
||||
GuacamoleSocket socket = new ConfiguredGuacamoleSocket(
|
||||
new InetGuacamoleSocket(hostname, port),
|
||||
config
|
||||
config, info
|
||||
);
|
||||
|
||||
// Associate socket with tunnel
|
||||
|
Reference in New Issue
Block a user