Properly select "guacamole" protocol.

This commit is contained in:
Michael Jumper
2013-10-15 23:48:19 -07:00
parent d7986bba59
commit 2db11ea489

View File

@@ -20,6 +20,7 @@ package org.glyptodon.guacamole.net.basic.websocket.tomcat;
*/
import java.io.IOException;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -107,6 +108,19 @@ public abstract class AuthenticatingWebSocketServlet extends WebSocketServlet {
}
@Override
protected String selectSubProtocol(List<String> subProtocols) {
// Search for expected protocol
for (String protocol : subProtocols)
if ("guacamole".equals(protocol))
return "guacamole";
// Otherwise, fail
return null;
}
@Override
public StreamInbound createWebSocketInbound(String protocol,
HttpServletRequest request) {