Class EffectiveClientIpResolver

java.lang.Object
com.soklet.EffectiveClientIpResolver

Resolves a client's effective IP address from a request's socket peer and forwarded headers.

Forwarded headers can be spoofed if Soklet is reachable directly. Choose a EffectiveOriginResolver.TrustPolicy that matches your deployment and, for EffectiveOriginResolver.TrustPolicy.TRUST_PROXY_ALLOWLIST, provide a trusted proxy predicate or allowlist. If the remote address is missing or not trusted, forwarded headers are ignored and the socket peer is returned when available.

Extraction order is: trusted Forwarded for= values, trusted X-Forwarded-For values, then the socket peer. Only IP literals are accepted from forwarded headers; hostnames, obfuscated identifiers, unknown, and malformed values are ignored.

Author:
Mark Allen