final class TrustedProxyList (View source)

An explicit list of proxy addresses. Unlike IpAddressRetriever's peer check, it trusts nothing implicitly: private and loopback addresses match only when listed.

Methods

__construct(array $entries)

No description

bool
matches(string $ip)

Whether the address matches an entry: an exact IP, a CIDR range (IPv4 or IPv6), or an IPv4 wildcard (e.g. 203.0.113.*).

Details

__construct(array $entries)

No description

Parameters

array $entries

IPs, CIDR ranges or IPv4 wildcards; non-strings are ignored

bool matches(string $ip)

Whether the address matches an entry: an exact IP, a CIDR range (IPv4 or IPv6), or an IPv4 wildcard (e.g. 203.0.113.*).

Parameters

string $ip

Return Value

bool