bugku | Where are you from

Topic Link

 

 

Before always thought that use x-forwarded-for, who use the road referer, Orz. In this specially recorded, the difference between x-forwarded-for and the referer


 

The For-Forwarded-X- ( XFF ): to identify the connection to the Web server by HTTP proxy client load balancing methods or the most original IP address of the HTTP request header field. 

Format is as follows:

X-Forwarded-For: client1, proxy1, proxy2

Where the value + space by a comma to separate multiple IP addresses area, the left-most (client1) is the most original client's IP address , proxy server every successful receipt of a request, put the request source IP address added to the right. In the above example, the request by the three successful proxy server: proxy1, proxy2 and proxy3. Request is issued by client1, it reached proxy3 (proxy3 endpoint may be requested). When the request is made just client1, XFF is empty, the request is sent to proxy1; proxy1 by time, is added to client1 XFF, after which the request is sent to proxy2; proxy2 by time, it is added to proxy1 XFF in after the request is sent to the proxy3; through proxy3, proxy2 be added to XFF, after which the request is unaccounted for, will continue to be forwarded if the request is not the end proxy3 request. In view of this field is very easy to forge, should be used with caution X-Forwarded-For field. XFF last IP address is the last IP address of the proxy server under normal circumstances, this is usually a more reliable source of information.

Referer:  an HTTP request header part of, when the browser (browser behavior or analog) to web when the server sends a request to the header information contained there   Referer. For example, I www.sojson.com have in a www.baidu.com link, click on this www.baidu.com , it's header information in there:

    Referer=https://www.sojson.com

It can be seen come. It is to represent a source tells the server which pages link to the page is coming from.

the difference between x-forwarded-for and the referer: My understanding is that x-forwarded-for to prove the ip like "127.0.0.1" this, and is used to justify referer "domain" of

Guess you like

Origin www.cnblogs.com/chrysanthemum/p/11525094.html