How JustAnswer Works:

  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.

Ask Joshua C. Your Own Question

Joshua C.
Joshua C., PC Technician
Category: Computer
Satisfied Customers: 703
Experience:  Microsoft Certified Desktop Support Technician with over 10 years of experience.
18519760
Type Your Computer Question Here...
Joshua C. is online now
A new question is answered every 9 seconds

x-http-forwarded

This answer was rated:

Hello,

 

I understand that x-http-forwarded should normally contain the IP address of the originating client if they are behind a proxy server. I recently implemented this in my code, but the code didn't work because x-http-forwarded returned more than one IP address and many were local IP addresses, not the proper internet connection IP address. How can I work out which is the correct IP address?

 

The reason I need this working is because we have developed a webstats system and we currently use ServerVariables["REMOTE_ADDR"] for IP addresses, but realise that some clients might be behind a proxy which would then give us the proxy server IP address not the originating IP address.

 

Best regards,

 

Tristan


Joshua C. :

Thank you for using JustAnswer.com my name is XXXXX XXXXX I am going to assist you today

Joshua C. :

In your code remove all results that return

Joshua C. :

127. 0.0.1 10. 0.0.0 – 10.255.255.255 172. 16.0.0 – 172. 31.255.255 192.168.0.0 – 192.168.255.255

Joshua C. :

The local Ip ranges

Joshua C. :

Which would be

Joshua C. :

(^127\.0\.0\.1)| (^10\.)| (^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)| (^192\.168\.)

Joshua C. :

using RegEx

Customer:

I'll give that a try thank you!

Joshua C. :

You are very welcome

Joshua C. and 3 other Computer Specialists are ready to help you

Related Computer Questions