TrustProxies
class TrustProxies (View source)
Properties
Methods
void
void
setTrustedProxyIpAddressesToSpecificIps(Request $request, array $trustedIps)
Specify the IP addresses to trust explicitly.
void
setTrustedProxyIpAddressesToTheCallingIp(Request $request)
Set the trusted proxy to be the IP address calling this servers.
int
getTrustedHeaderNames()
Retrieve trusted header name(s), falling back to defaults if config not set.
int
headers()
Get the trusted headers.
array|string|null
proxies()
Get the trusted proxies.
static void
at(array|string $proxies)
Specify the IP addresses of proxies that should always be trusted.
static void
withHeaders(int $headers)
Specify the proxy headers that should always be trusted.
static void
flushState()
Flush the state of the middleware.
Details
protected void
setTrustedProxyIpAddresses(Request $request)
Sets the trusted proxies on the request.
protected void
setTrustedProxyIpAddressesToSpecificIps(Request $request, array $trustedIps)
Specify the IP addresses to trust explicitly.
protected void
setTrustedProxyIpAddressesToTheCallingIp(Request $request)
Set the trusted proxy to be the IP address calling this servers.
protected int
getTrustedHeaderNames()
Retrieve trusted header name(s), falling back to defaults if config not set.
static void
at(array|string $proxies)
Specify the IP addresses of proxies that should always be trusted.