0

I am using

HttpContext.Current.Request.UserHostAddress;

but I want to know if the request being made is with the original ip of the requestee or begin masked by the anonymous proxy servers i.e. zenmate etc.

How to figure that out ?

azure boy
  • 193
  • 8
  • Do you have a list of anonymous proxy servers to verify against? You can't always tell whether the request originates via a proxy from the request headers because these can be manipulated – Martin Nov 19 '18 at 13:05
  • As @MartinParkin states, it's not 100% reliable. There is `HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"]` but I don't know how reliable it is. – Steve Nov 19 '18 at 13:08
  • @Steve I am using Zenmate but still this HTTP_X_FORWARDED_FOR comes null in the program why ? – azure boy Nov 19 '18 at 13:20
  • Because not all proxies add that header - some may. As was said earlier I don't think there is a reliable way. The client_IP may work. https://stackoverflow.com/questions/7445592/what-is-the-difference-between-http-client-ip-and-http-x-forwarded-for – Steve Nov 19 '18 at 13:23
  • You may want to do a for each on the `HttpContext.Current.Request.ServerVariables` keys and see exactly what Zenmate is passing - though that would probably only be applicable to Zenmate. – Steve Nov 19 '18 at 13:35

0 Answers0