Browser IP Address

倖福魔咒の 提交于 2019-12-09 23:41:15

问题


I have 2 apps

1 Ruby (not written by me. I understand nothing of Ruby) and the other ASP.Net

The Ruby app determines the users's IP address (I'm told "using first IP found in "HTTP_X_FORWARDED" )and passes a hashed version of it to the ASP.Net app.

The ASP.Net app then determines the Client's IP address again (using Request.UserHostAddress) and hashes the value.

Then hashes are compared.

Generally these hashes are identical ( as you might expect) for all our clients.

However we have 1 new client for which this is not the case...

Every computer at his workplace apparently produces hashes which are not equal

How can this be?


回答1:


It depends on the proxy they're going through.

The Wikipedia page for the X-Forwarded-For header is informative on this front.

If you want the hashes to match, you should get the data from the same header. UserHostAddress is determined by the REMOTE_ADDR server variable (I believe).



来源:https://stackoverflow.com/questions/756067/browser-ip-address

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!