public class UpgradeUtil
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static void |
doUpgrade(WsServerContainer sc,
HttpServletRequest req,
HttpServletResponse resp,
ServerEndpointConfig sec,
java.util.Map<java.lang.String,java.lang.String> pathParams) |
static boolean |
isWebSocketUpgradeRequest(ServletRequest request,
ServletResponse response)
Checks to see if this is an HTTP request that includes a valid upgrade
request to web socket.
|
public static boolean isWebSocketUpgradeRequest(ServletRequest request, ServletResponse response)
Note: RFC 2616 does not limit HTTP upgrade to GET requests but the Java WebSocket spec 1.0, section 8.2 implies such a limitation and RFC 6455 section 4.1 requires that a WebSocket Upgrade uses GET.
request
- The request to check if it is an HTTP upgrade request for
a WebSocket connectionresponse
- The response associated with the requesttrue
if the request includes a HTTP Upgrade request
for the WebSocket protocol, otherwise false
public static void doUpgrade(WsServerContainer sc, HttpServletRequest req, HttpServletResponse resp, ServerEndpointConfig sec, java.util.Map<java.lang.String,java.lang.String> pathParams) throws ServletException, java.io.IOException
ServletException
java.io.IOException
Copyright © 2000-2018 Apache Software Foundation. All Rights Reserved.