Package io.undertow.websockets
Class WebSocketProtocolHandshakeHandler
java.lang.Object
io.undertow.websockets.WebSocketProtocolHandshakeHandler
- All Implemented Interfaces:
HttpHandler
HttpHandler which will process the HttpServerExchange and do the actual handshake/upgrade
to WebSocket.- Author:
- Norman Maurer
-
Constructor Summary
ConstructorsConstructorDescriptionCreate a newWebSocketProtocolHandshakeHandlerWebSocketProtocolHandshakeHandler(HttpUpgradeListener callback, HttpHandler next) Create a newWebSocketProtocolHandshakeHandlerCreate a newWebSocketProtocolHandshakeHandlerWebSocketProtocolHandshakeHandler(WebSocketConnectionCallback callback, HttpHandler next) Create a newWebSocketProtocolHandshakeHandlerWebSocketProtocolHandshakeHandler(Collection<Handshake> handshakes, HttpUpgradeListener callback) Create a newWebSocketProtocolHandshakeHandlerWebSocketProtocolHandshakeHandler(Collection<Handshake> handshakes, HttpUpgradeListener callback, HttpHandler next) Create a newWebSocketProtocolHandshakeHandlerWebSocketProtocolHandshakeHandler(Collection<Handshake> handshakes, WebSocketConnectionCallback callback) Create a newWebSocketProtocolHandshakeHandlerWebSocketProtocolHandshakeHandler(Collection<Handshake> handshakes, WebSocketConnectionCallback callback, HttpHandler next) Create a newWebSocketProtocolHandshakeHandler -
Method Summary
Modifier and TypeMethodDescriptionaddExtension(ExtensionHandshake extension) Add a new WebSocket Extension into the handshakes defined in this handler.voidhandleRequest(HttpServerExchange exchange) Handle the request.
-
Constructor Details
-
WebSocketProtocolHandshakeHandler
Create a newWebSocketProtocolHandshakeHandler- Parameters:
callback- TheWebSocketConnectionCallbackwhich will be executed once the handshake was established
-
WebSocketProtocolHandshakeHandler
Create a newWebSocketProtocolHandshakeHandler- Parameters:
callback- TheWebSocketConnectionCallbackwhich will be executed once the handshake was established
-
WebSocketProtocolHandshakeHandler
public WebSocketProtocolHandshakeHandler(Collection<Handshake> handshakes, WebSocketConnectionCallback callback) Create a newWebSocketProtocolHandshakeHandler- Parameters:
handshakes- The supported handshake methodscallback- TheWebSocketConnectionCallbackwhich will be executed once the handshake was established
-
WebSocketProtocolHandshakeHandler
public WebSocketProtocolHandshakeHandler(Collection<Handshake> handshakes, WebSocketConnectionCallback callback, HttpHandler next) Create a newWebSocketProtocolHandshakeHandler- Parameters:
handshakes- The supported handshake methodscallback- TheWebSocketConnectionCallbackwhich will be executed once the handshake was established
-
WebSocketProtocolHandshakeHandler
Create a newWebSocketProtocolHandshakeHandler- Parameters:
callback- TheWebSocketConnectionCallbackwhich will be executed once the handshake was established
-
WebSocketProtocolHandshakeHandler
Create a newWebSocketProtocolHandshakeHandler- Parameters:
callback- TheWebSocketConnectionCallbackwhich will be executed once the handshake was established
-
WebSocketProtocolHandshakeHandler
public WebSocketProtocolHandshakeHandler(Collection<Handshake> handshakes, HttpUpgradeListener callback) Create a newWebSocketProtocolHandshakeHandler- Parameters:
handshakes- The supported handshake methodscallback- TheWebSocketConnectionCallbackwhich will be executed once the handshake was established
-
WebSocketProtocolHandshakeHandler
public WebSocketProtocolHandshakeHandler(Collection<Handshake> handshakes, HttpUpgradeListener callback, HttpHandler next) Create a newWebSocketProtocolHandshakeHandler- Parameters:
handshakes- The supported handshake methodscallback- TheWebSocketConnectionCallbackwhich will be executed once the handshake was established
-
-
Method Details
-
handleRequest
Description copied from interface:HttpHandlerHandle the request.- Specified by:
handleRequestin interfaceHttpHandler- Parameters:
exchange- the HTTP request/response exchange- Throws:
Exception
-
getPeerConnections
-
addExtension
Add a new WebSocket Extension into the handshakes defined in this handler.- Parameters:
extension- a newExtensionHandshakeinstance- Returns:
- current handler
-