Interface ServerUpgradeRequest

All Superinterfaces:
Attributes, Content.Source, Request

public interface ServerUpgradeRequest extends Request
Upgrade request used for websocket negotiation.

Provides getters for things like the requested extensions and subprotocols so that the headers don't have to be parsed manually.

This should only be used during the websocket negotiation.

  • Method Details

    • getWebSocketComponents

      WebSocketComponents getWebSocketComponents()
      Returns:
      The WebSocket components used for this upgrade request
    • getExtensions

      List<ExtensionConfig> getExtensions()
      Returns:
      The extensions offered
    • getProtocolVersion

      String getProtocolVersion()
      Returns:
      WebSocket protocol version from "Sec-WebSocket-Version" header
    • getSubProtocols

      List<String> getSubProtocols()
      Returns:
      Get WebSocket negotiation offered sub protocols
    • hasSubProtocol

      boolean hasSubProtocol(String subprotocol)
      Parameters:
      subprotocol - A sub protocol name
      Returns:
      True if the sub protocol was offered