Interface ProtocolUpgradeHandler

All Superinterfaces:
Handler, ServerLifecycle
All Known Implementing Classes:
SecureHandler, SecurityHandler

public interface ProtocolUpgradeHandler extends Handler
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 Details

    • handleProtocolUpgrade

      void handleProtocolUpgrade(ServerRequest req, ServerResponse res) throws Exception
      Handle an HTTP/1 protocol upgrade request before the protocol switch. The handler follows the same response contract as ordinary routing: call ServerResponse.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 request
      res - server response
      Throws:
      Exception - in case of a processing error