Class ClientAddressResolver.TrustedProxies
java.lang.Object
com.iizix.server.geo.ip2location.ClientAddressResolver.TrustedProxies
- Enclosing class:
ClientAddressResolver
The operator's trusted proxies: a set of IP addresses and CIDR prefixes.
- Author:
- Christopher Mindus
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ClientAddressResolver.TrustedProxiesNo trusted proxies: every forwarded header is ignored.Method Summary
Modifier and TypeMethodDescriptionbooleancontains(InetAddress address) Checks if an address is a trusted proxy.intGets the number of entries that were dropped byparse(String).booleanisEmpty()Returns if no proxy is trusted.Parses a comma- or whitespace-separated list of IP addresses and CIDR prefixes, e.g.intsize()Gets the number of configured entries.
Field Details
NONE
No trusted proxies: every forwarded header is ignored.
Method Details
parse
Parses a comma- or whitespace-separated list of IP addresses and CIDR prefixes, e.g."10.0.0.5, 192.168.0.0/16, fd00::/8". An entry that is not an IP literal, or whose prefix length is out of range, is dropped and counted ingetRejectedCount(); nothing is resolved through DNS.- Parameters:
list- The list, null or blank for none.- Returns:
- The trusted proxies,
NONEfor an empty list.
isEmpty
public boolean isEmpty()Returns if no proxy is trusted.- Returns:
- true when the set is empty.
size
public int size()Gets the number of configured entries.- Returns:
- The count of accepted entries.
getRejectedCount
public int getRejectedCount()Gets the number of entries that were dropped byparse(String).- Returns:
- The count of rejected entries.
contains
Checks if an address is a trusted proxy.- Parameters:
address- The address, null is never trusted.- Returns:
- true when the address matches an entry.