Class RemoteAddress

Summary

Fully Qualified Name: Zend\Http\PhpEnvironment\RemoteAddress

Description

Functionality for determining client IP address.

Methods

Name Description Defined By
getIpAddress() Returns client IP address. RemoteAddress
getUseProxy() Checks proxy handling setting. RemoteAddress
setProxyHeader() Set the header to introspect for proxy IPs RemoteAddress
setTrustedProxies() Set list of trusted proxy addresses RemoteAddress
setUseProxy() Changes proxy handling setting. RemoteAddress

Method Details

getIpAddress()

Returns client IP address.

Returns: string IP address.

getUseProxy()

Checks proxy handling setting.

Returns: bool Current setting value.

setProxyHeader()

Set the header to introspect for proxy IPs

Parameter Name Type Description
$header string

Returns: \RemoteAddress

setTrustedProxies()

Set list of trusted proxy addresses

Parameter Name Type Description
$trustedProxies array

Returns: \RemoteAddress

setUseProxy()

Changes proxy handling setting.

This must be static method, since validators are recovered automatically at session read, so this is the only way to switch setting.

Parameter Name Type Description
$useProxy bool Whether

Returns: \RemoteAddress

Top