getIpAddress()
getUseProxy()
setProxyHeader()
setTrustedProxies()
setUseProxy()
getIpAddressFromProxy()
normalizeProxyHeader()
$proxyHeader
$trustedProxies
$useProxy
Functionality for determining client IP address.
getIpAddress() : string
string
IP address.getUseProxy() : bool
bool
Current setting value.setProxyHeader(string $header) : \Zend\Http\PhpEnvironment\RemoteAddress
setTrustedProxies(array $trustedProxies) : \Zend\Http\PhpEnvironment\RemoteAddress
setUseProxy(bool $useProxy) : \Zend\Http\PhpEnvironment\RemoteAddress
This must be static method, since validators are recovered automatically at session read, so this is the only way to switch setting.
bool
Whether to check also proxied IP addresses.
getIpAddressFromProxy() : false | string
see | \Zend\Http\PhpEnvironment\http://tools.ietf.org/html/draft-ietf-appsawg-http-forwarded-10#section-5.2 |
---|
false
string
normalizeProxyHeader(string $header) : string
Normalizes a header string to a format that is compatible with $_SERVER
string
string
$proxyHeader : string
$trustedProxies : array
$useProxy : bool
As default this setting is disabled - IP address is mostly needed to increase security. HTTP_* are not reliable since can easily be spoofed. It can be enabled just for more flexibility, but if user uses proxy to connect to trusted services it's his/her own risk, only reliable field for IP address is $_SERVER['REMOTE_ADDR'].