function Request::getClientIps
Returns the client IP addresses.
In the returned array the most trusted IP address is first, and the least trusted one last. The "real" client IP address is the last one, but this is also the least trusted one. Trusted proxies are stripped.
Use this method carefully; you should use getClientIp() instead.
See also
getClientIp()
File
-
vendor/
symfony/ http-foundation/ Request.php, line 742
Class
- Request
- Request represents an HTTP request.
Namespace
Symfony\Component\HttpFoundationCode
public function getClientIps() : array {
$ip = $this->server
->get('REMOTE_ADDR');
if (!$this->isFromTrustedProxy()) {
return [
$ip,
];
}
return $this->getTrustedValues(self::HEADER_X_FORWARDED_FOR, $ip) ?: [
$ip,
];
}