Infer the remote IP address from the X-Forwarded-For header,
trusting requests from any private IP address. See realIpHeader and
realIpTrusted for more information and options.
Modulewai-extra-3.1.16Haskell2010
Network.Wai.Middleware.RealIp
Infer the remote IP address using headers
- 5 values
- Packagewai-extra-3.1.16
- Exports5
- LanguageHaskell2010
- LicenceMIT
- SourceRealIp.hs
Infer the remote IP address using the given header, trusting requests from any private IP address. See realIpTrusted for more information and options.
Infer the remote IP address using the given header, but only if the request came from an IP that is trusted by the provided predicate.
The last non-trusted address is used to replace the remoteHost in
the Request, unless all present IP addresses are trusted, in which
case the first address is used. Invalid IP addresses are ignored, and
the remoteHost value remains unaltered if no valid IP addresses are
found.
Examples:
realIpTrusted "X-Forwarded-For" $ flip ipInRange "10.0.0.0/8" realIpTrusted "X-Real-Ip" $ \ip -> any (ipInRange ip) defaultTrustedStandard private IP ranges.
Check if the given IP address is in the given range.
IPv4 addresses can be checked against IPv6 ranges, but testing an IPv6 address against an IPv4 range is always False.