Closed pbojinov closed 2 years ago
@pbojinov According to CloudFlare docs, there is another header worth it to be supported:
The three options available for configuring Pseudo IPv4 are:
- Off: This is the default value.
- Add Header: Cloudflare automatically adds the Cf-Pseudo-IPv4 header with a Class E IPv4 address hashed from the original IPv6 address.
- Overwrite Headers - Cloudflare overwrites the existing Cf-Connecting-IP and X-Forwarded-For headers with a pseudo IPv4 address while preserving the real IPv6 address in a Cf-Connecting-IPv6 header.
so if you add support Cf-Connecting-IPv6
as well, that will cover all the possibilities 🙂
@Kikobeats thanks for pointing that out. I’ll add that as well.
Fixes https://github.com/pbojinov/request-ip/issues/46
Cf-Pseudo-IPv4
as a last resort – https://blog.cloudflare.com/eliminating-the-last-reasons-to-not-enable-ipv6/#introducingpseudoipv4