mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-07 21:51:23 +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 javax.servlet.http.HttpSession;
|
||||||
import net.sourceforge.guacamole.GuacamoleException;
|
import net.sourceforge.guacamole.GuacamoleException;
|
||||||
import net.sourceforge.guacamole.GuacamoleSecurityException;
|
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.GuacamoleSocket;
|
||||||
import net.sourceforge.guacamole.net.GuacamoleTunnel;
|
import net.sourceforge.guacamole.net.GuacamoleTunnel;
|
||||||
|
import net.sourceforge.guacamole.net.InetGuacamoleSocket;
|
||||||
import net.sourceforge.guacamole.net.auth.Credentials;
|
import net.sourceforge.guacamole.net.auth.Credentials;
|
||||||
import net.sourceforge.guacamole.net.basic.event.SessionListenerCollection;
|
import net.sourceforge.guacamole.net.basic.event.SessionListenerCollection;
|
||||||
import net.sourceforge.guacamole.net.event.TunnelCloseEvent;
|
import net.sourceforge.guacamole.net.event.TunnelCloseEvent;
|
||||||
import net.sourceforge.guacamole.net.event.TunnelConnectEvent;
|
import net.sourceforge.guacamole.net.event.TunnelConnectEvent;
|
||||||
import net.sourceforge.guacamole.net.event.listener.TunnelCloseListener;
|
import net.sourceforge.guacamole.net.event.listener.TunnelCloseListener;
|
||||||
import net.sourceforge.guacamole.net.event.listener.TunnelConnectListener;
|
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.ConfiguredGuacamoleSocket;
|
||||||
|
import net.sourceforge.guacamole.protocol.GuacamoleClientInformation;
|
||||||
|
import net.sourceforge.guacamole.protocol.GuacamoleConfiguration;
|
||||||
import net.sourceforge.guacamole.servlet.GuacamoleHTTPTunnelServlet;
|
import net.sourceforge.guacamole.servlet.GuacamoleHTTPTunnelServlet;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
@@ -183,13 +184,26 @@ public class BasicGuacamoleTunnelServlet extends AuthenticatingHttpServlet {
|
|||||||
|
|
||||||
logger.info("Successful connection from {} to \"{}\".", request.getRemoteAddr(), id);
|
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
|
// Configure and connect socket
|
||||||
String hostname = GuacamoleProperties.getProperty(GuacamoleProperties.GUACD_HOSTNAME);
|
String hostname = GuacamoleProperties.getProperty(GuacamoleProperties.GUACD_HOSTNAME);
|
||||||
int port = GuacamoleProperties.getProperty(GuacamoleProperties.GUACD_PORT);
|
int port = GuacamoleProperties.getProperty(GuacamoleProperties.GUACD_PORT);
|
||||||
|
|
||||||
GuacamoleSocket socket = new ConfiguredGuacamoleSocket(
|
GuacamoleSocket socket = new ConfiguredGuacamoleSocket(
|
||||||
new InetGuacamoleSocket(hostname, port),
|
new InetGuacamoleSocket(hostname, port),
|
||||||
config
|
config, info
|
||||||
);
|
);
|
||||||
|
|
||||||
// Associate socket with tunnel
|
// Associate socket with tunnel
|
||||||
|
Reference in New Issue
Block a user