Struggling with accurate IPv6 address detection for our 'What is my IP' tool behind Cloudflare
0
so we run this pretty popular 'What is my IP Address' web tool, and honestly, it's super critical for so many users to help them diagnose all sorts of network issues, you know? getting the correct ip is everything for them. but lately we're just hitting a wall, a really big one, when it comes to reliably and accurately performing client IP detection for the true client-side IPv6 address. especially when folks are sitting behind CDNs like Cloudflare, or even various proxy and VPN setups. it's a nightmare sometimes, often our tool just reports an IPv4 address, or worse, a completely incorrect IPv6, even for clients who are definitely connecting with IPv6. we've tried so many things already, you know, implemented all the standard checks for HTTP headers like
X-Forwarded-For and X-Real-IP, thinking that'd cover most bases. we also dug deep into server-side environment variables, things like $_SERVER['REMOTE_ADDR'] if we're talking PHP, or the equivalents in node.js and python, but it's just not cutting it consistently. explored cloudflare-specific headers too, like CF-Connecting-IP, when we detect cloudflare in the mix, and even thought about third-party ip detection APIs for a bit, but honestly, we really prefer a self-hosted, privacy-focused solution for performance and to keep control over our data, so that's kinda off the table for now. the specific observations, or rather, the failures we're seeing are really frustrating. cloudflare, for instance, it frequently presents an IPv4 address in REMOTE_ADDR even when the actual client connection is IPv6, or it just masks the true client IPv6 altogether, which is a huge headache for accurate client IP detection. then you've got corporate proxies and some VPNs, they just seem to strip or modify the IPv6 headers, making it incredibly hard to trace back to the original client. and it's super tough to distinguish between an intermediary's IPv6 and the end-user's actual IPv6. so, our key question is this: what are the most robust, truly reliable, and technically sound methods to accurately determine the *true* client-side IPv6 address for a 'what is my ip' service, particularly when dealing with CDN layers, like cloudflare, and these really complex proxy network setups, ensuring we provide the absolute most accurate information to our users0 Answers
No answers yet.
Be the first to provide a helpful answer!
Your Answer
You must Log In to post an answer and earn reputation.
Hot Discussions
4
Better ISP finder data?
290 Views