开发者

What is the difference between HTTP_X_FORWARDED_FOR and HTTP_FORWARDED

开发者 https://www.devze.com 2023-01-05 11:16 出处:网络
I have been looking for a way to find the IP Addres开发者_运维问答s of the client and I\'ve found both of these HTTP Headers.From what I\'ve found they are the same thing, but HTTP_X_FORWARDED_FOR see

I have been looking for a way to find the IP Addres开发者_运维问答s of the client and I've found both of these HTTP Headers. From what I've found they are the same thing, but HTTP_X_FORWARDED_FOR seems more widely used. Do any of you know what the difference is and if I am going to have to check both of these? Thanks.


X-Forwarded-For header is not part of RFC, hence different implementation by proxy servers. You should not rely on that value since it can be spoofed or simply not sent by proxy.

If it is important and you can afford to do it you should force requests through HTTPS and look up REMOTE_ADDR.

0

精彩评论

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