Sameer Ali
CDCloudflare Developers
•Created by Sameer Ali on 3/8/2025 in #workers-help
How do i get IPv4 in worker
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?
4 replies