Interface ProtocolUpgradeHandler
- All Superinterfaces:
Handler, ServerLifecycle
- All Known Implementing Classes:
SecureHandler, SecurityHandler
Handler that can enforce route policy for an HTTP/1 protocol upgrade request
without invoking the route endpoint handler.
Implementations must call ServerResponse.next() to allow the protocol
switch to continue, send a response to reject the switch, or reroute the
request back to ordinary HTTP routing. Ordinary HTTP endpoint handlers are
intentionally not invoked while routing upgrade policy.
-
Method Summary
Modifier and TypeMethodDescriptionvoidhandleProtocolUpgrade(ServerRequest req, ServerResponse res) Handle an HTTP/1 protocol upgrade request before the protocol switch.Methods inherited from interface Handler
handleModifier and TypeMethodDescriptionvoidhandle(ServerRequest req, ServerResponse res) Handle request.Methods inherited from interface ServerLifecycle
afterStart, afterStop, beforeStartModifier and TypeMethodDescriptiondefault voidafterStart(WebServer webServer) After server start.default voidAfter server stop.default voidBefore server start.
-
Method Details
-
handleProtocolUpgrade
Handle an HTTP/1 protocol upgrade request before the protocol switch. The handler follows the same response contract as ordinary routing: callServerResponse.next()to allow the protocol switch, send a response to reject the switch, or reroute the request back to ordinary HTTP routing.- Parameters:
req- server requestres- server response- Throws:
Exception- in case of a processing error
-