Interface GrpcConnectionContext


public interface GrpcConnectionContext
Exposes connection-level information to gRPC request handlers. An instance of this interface is available from ServerContextKeys.CONNECTION_CONTEXT in the current gRPC context.
  • Method Details

    • serverSocketId

      String serverSocketId()
      Server socket id.
      Returns:
      socket id
    • connectionSocketId

      String connectionSocketId()
      Connection socket id.
      Returns:
      child socket id, never null
    • remotePeer

      PeerInfo remotePeer()
      Remote peer information.
      Returns:
      peer info
    • localPeer

      PeerInfo localPeer()
      Local peer information.
      Returns:
      peer info
    • isSecure

      boolean isSecure()
      Whether the request is secure.
      Returns:
      whether secure
    • proxyProtocolData

      Optional<ProxyProtocolData> proxyProtocolData()
      Proxy protocol header data.
      Returns:
      protocol header data if proxy protocol is enabled on socket
      See Also:
    • sniRequestedHost

      default Optional<String> sniRequestedHost()
      Normalized DNS host name requested by the client using TLS Server Name Indication (SNI).

      This value comes from the client TLS handshake, so it is suitable for diagnostics and application choices that are expected to use client-requested host names, but it should not be treated as a trusted identity by itself.

      Returns:
      normalized SNI requested host, if available
    • sniMatchedHost

      default Optional<String> sniMatchedHost()
      Configured virtual-host host that matched the TLS Server Name Indication (SNI) requested host.

      For wildcard virtual hosts, this method returns the configured wildcard host such as *.example.com.

      Returns:
      configured SNI matched host, if a virtual host matched