TrustedProxy class final
Trusted reverse-proxy settings for resolving the client IP from headers.
When headers is empty, resolve uses only the TCP remote address. Otherwise each header's comma-separated list is scanned for the first valid IP (rightmost by default; leftmost when useLeftmostIp is true).
Constructors
-
TrustedProxy({List<
String> headers = const [], bool useLeftmostIp = false}) -
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
-
headers
→ List<
String> -
Header names to check in order
(e.g.
X-Forwarded-For,CF-Connecting-IP).final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- useLeftmostIp → bool
-
When
true, use the leftmost valid IP in each header value.final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
resolve(
String? remoteIp, Headers headers) → String? -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited