#How do i get IPv4 in worker

1 messages · Page 1 of 1 (latest)

spring current
#

I’m trying to retrieve the IPv4 address in my Cloudflare Worker, but both x-forwarded-for and cf-connecting-ip only return an IPv6 address. However, when I open https://www.cloudflare.com/cdn-cgi/trace directly in my browser, it shows an IPv4 address, but this doesn’t happen inside the Worker. Any ideas why?

maiden glacier
#

Whichever one it picks, is going to be the one used. If you connect over IPv6, there's no way to directly get the client's IPv4 from the connection