IPv4 and IPv6 in CF-Connecting-IP header

I am trying to get real client IP with CF-Connecting-IP header. I noticed that sometimes it is returned IPv4 and sometimes IPv6. Is it possible to specify which IP version I want?
I would like to get both actually, something like this

CF-Connecting-IPv4 and CF-Connecting-IPv6. If the client has only one, then the second is empty, if the client has both, I want to get both.
for example, if I go to this website whatismyipaddress . com then I can see both IPs (IPv6 and IPv4).

Is it possible? I am not asking about Pseudo IPv4. I am asking how to get both IPs if the client has both IPs.

The header will contain the IP address from which the client sent the request. As a request can only be sent from one address, you’ll only get that address and that’s the one where it was sent from.

The Pseudo IPv4 feature is only when you get IPv6 requests but your server cannot handle IPv6 addresses.

1 Like

I see, but how this website whatismyipaddress . com shows my both IPs? Do they use some tricks there?

They will simply send two requests via both protocols.

ok, I see. thank you.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.