Struggling to Accurately Display User's Public IP Address on Our 'What is My IP' Tool
0
Hey everyone, hope you're having a productive week!
We've got a simple "What is my IP Address" tool on our site that gets a decent amount of traffic. It's pretty straightforward, just tells users their public IP. However, we've started noticing some inconsistencies lately.
- The Problem: Sometimes, especially for users behind certain corporate networks or VPNs, the displayed IP isn't their true external public IP. It occasionally shows an internal proxy IP or even a CDN IP, which isn't what they're expecting.
- Current Setup: We're primarily using PHP's
$_SERVER['REMOTE_ADDR']and falling back to checking$_SERVER['HTTP_X_FORWARDED_FOR'], but it feels like we're missing something for robust accuracy. - The Goal: We want to ensure our tool consistently and accurately provides the user's actual external public IP address, even through complex network setups.
- Seeking Advice: What are the most reliable methods or best practices you've found for accurately determining a user's true public IP address in a web application context? Are there specific headers or services we should be leveraging more effectively?
0 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?
292 Views