开发者

Is Request.ServerVariables["REMOTE_ADDR"] reliable enough?

开发者 https://www.devze.com 2023-01-11 18:17 出处:网络
Currently I am using Request.ServerVariables[\"REMOTE_ADDR\"] t开发者_开发技巧o get the IP from the client.

Currently I am using Request.ServerVariables["REMOTE_ADDR"] t开发者_开发技巧o get the IP from the client.

What guarantees I get when calling this Method. Or should I look in other ServerVariables as well?


Found some really neat information on retrieving the client's IP address here.

Essentially, you should probably also pay attention to the Request.ServerVariables("HTTP_X_FORWARDED_FOR") as well. This helps to identify the actual IP address if the end user is going through a proxy whereas the REMOTE_ADDR attribute would be the address of the proxy...unless it is an anonymous proxy in which case, you would still just get the proxy address.

0

精彩评论

暂无评论...
验证码 换一张
取 消