如何解决鳄梨调味酱-在运行vnc服务器之前获取浏览器客户端分辨率
我在鳄梨酱(https://guacamole.apache.org/doc/gug/event-listeners.html)中使用了事件侦听器机制。 我捕获了AuthenticationSuccessEvent以在远程服务器上启动vncserver,并捕获了TunnelCloseEvent以停止vncserver。 至此,我解析了user-mapping.xml文件,以获取配置vnc服务器所需的端口和密码。 我也想获得浏览器的分辨率。
if (event instanceof AuthenticationSuccessEvent) {
String query = String.format("username=%s&password=%s&port=%s",URLEncoder.encode(param1,charset),URLEncoder.encode(param2,URLEncoder.encode(param3,charset));
// GET send http request to remote server then start a vncserver
URLConnection connection = new URL(url_connect + "?" + query).openConnection();
connection.setRequestProperty("Accept-Charset",charset);
InputStream response = connection.getInputStream();
try (Scanner scanner = new Scanner(response)) {
String responseBody = scanner.useDelimiter("\\A").next();
}
}
else if (event instanceof TunnelCloseEvent) {
String query = String.format("username=%s",charset));
URLConnection connection = new URL(url_disconnect + "?" + query).openConnection();
connection.setRequestProperty("Accept-Charset",charset);
InputStream response = connection.getInputStream();
try (Scanner scanner = new Scanner(response)) {
String responseBody = scanner.useDelimiter("\\A").next();
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。