zoukankan      html  css  js  c++  java
  • What is the difference between HTTP_CLIENT_IP and HTTP_X_FORWARDED_FOR

    What is the difference between HTTP_CLIENT_IP and HTTP_X_FORWARDED_FOR?

    it is impossible to say. Different proxies may implement these, or may not. The implementations may vary from one proxy to the next, and they may not. A lack of a standard breeds question marks.

    Why would one have different values than the other?

    See point 1. However, from a purely practical point of view, the only reason I can see for these having different values is if more than one proxy was involved - the X-Forwarded-For: header might then contain a complete track of the forwarding chain, whereas the Client-IP: header would contain the actual client IP. This is pure speculation, however.

    Where can I find resources on the exact definition of these headers.

    Where can I find resources on the exact definition of these headers. - You can't. See point 1.


    There does seem to be some kind of de-facto standard regarding the X-Forwarded-For: header, but given that there is no RFC that defines it this cannot be relied upon see comment below.

    As a side note, the Client-IP: header should by convention be X-Client-IP: since it is a 'user-defined' header.

  • 相关阅读:
    147
    寻宝
    将军鬼上身啦!
    洛谷P2762 太空飞行计划问题 网络流
    洛谷P3376 【模板】网络最大流
    洛谷P2375 [NOI2014]动物园
    洛谷P2672 推销员
    洛谷P1878 舞蹈课 贪心 堆
    洛谷P3375 【模板】KMP字符串匹配 kmp模板
    洛谷P2906 [USACO08OPEN]牛的街区Cow Neighborhoods
  • 原文地址:https://www.cnblogs.com/junmo/p/5669216.html
Copyright © 2011-2022 走看看