Package brave.http

Class HttpServerRequest

    • Constructor Detail

      • HttpServerRequest

        public HttpServerRequest()
    • Method Detail

      • parseClientIpAndPort

        public boolean parseClientIpAndPort​(Span span)
        Used by HttpServerHandler.handleReceive(HttpServerRequest) to add remote socket information about the client from the delegate.

        By default, this tries to parse the forwarded IP. Override to add client socket information when forwarded info is not available.

        Aside: It is more likely a server request object will be able to parse socket information as opposed to a client object. This is because client requests are often parsed before a network route is chosen, whereas server requests are parsed after the network layer.

        Returns:
        true if parsing was successful.
        Since:
        5.7
      • parseClientIpFromXForwardedFor

        protected boolean parseClientIpFromXForwardedFor​(Span span)
        Uses the first value in the "X-Forwarded-For" header, or returns false if not present.
        Since:
        5.10