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 newWebSocketProtocolHandshakeHandler
WebSocketProtocolHandshakeHandler
(HttpUpgradeListener callback, HttpHandler next) Create a newWebSocketProtocolHandshakeHandler
Create a newWebSocketProtocolHandshakeHandler
WebSocketProtocolHandshakeHandler
(WebSocketConnectionCallback callback, HttpHandler next) Create a newWebSocketProtocolHandshakeHandler
WebSocketProtocolHandshakeHandler
(Collection<Handshake> handshakes, HttpUpgradeListener callback) Create a newWebSocketProtocolHandshakeHandler
WebSocketProtocolHandshakeHandler
(Collection<Handshake> handshakes, HttpUpgradeListener callback, HttpHandler next) Create a newWebSocketProtocolHandshakeHandler
WebSocketProtocolHandshakeHandler
(Collection<Handshake> handshakes, WebSocketConnectionCallback callback) Create a newWebSocketProtocolHandshakeHandler
WebSocketProtocolHandshakeHandler
(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.void
handleRequest
(HttpServerExchange exchange) Handle the request.
-
Constructor Details
-
WebSocketProtocolHandshakeHandler
Create a newWebSocketProtocolHandshakeHandler
- Parameters:
callback
- TheWebSocketConnectionCallback
which will be executed once the handshake was established
-
WebSocketProtocolHandshakeHandler
Create a newWebSocketProtocolHandshakeHandler
- Parameters:
callback
- TheWebSocketConnectionCallback
which 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
- TheWebSocketConnectionCallback
which 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
- TheWebSocketConnectionCallback
which will be executed once the handshake was established
-
WebSocketProtocolHandshakeHandler
Create a newWebSocketProtocolHandshakeHandler
- Parameters:
callback
- TheWebSocketConnectionCallback
which will be executed once the handshake was established
-
WebSocketProtocolHandshakeHandler
Create a newWebSocketProtocolHandshakeHandler
- Parameters:
callback
- TheWebSocketConnectionCallback
which 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
- TheWebSocketConnectionCallback
which 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
- TheWebSocketConnectionCallback
which will be executed once the handshake was established
-
-
Method Details
-
handleRequest
Description copied from interface:HttpHandler
Handle the request.- Specified by:
handleRequest
in 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 newExtensionHandshake
instance- Returns:
- current handler
-