Transferred from: http://www.cnblogs.com/heiing/archive/2010/04/19/1715304.html
To determine whether a client uses a proxy server, it can be judged from the environment variable information sent by the client.
Specifically, just look at the Http_via field, if this field is set, the client uses a proxy server.
The anonymous level can be judged by the following table.
Give an example of application, you can hang up the agent trial effect: http://ip.mixsec.org/
one, not using the proxy server situation :
REMOTE_ADDR = Your IP
Http_via = no value or no display
Http_x_forwarded_for = no value or no display
second, the use of transparent proxy server situation: Transparent Proxies
REMOTE_ADDR = Proxy Server IP
Http_via = proxy IP ( supplemental: This field is populated by a proxy server, sometimes populating gateway information, etc. )
Http_x_forwarded_for = Your real IP
This type of proxy server also forwards your information to your Access object, and does not achieve the purpose of hiding the true identity.
third, the use of ordinary anonymous proxy server situation: Anonymous Proxies
REMOTE_ADDR = Proxy Server IP
Http_via = proxy IP ( supplemental: This field is populated by a proxy server, sometimes populating gateway information, etc. )
http_x_forwarded_for = Proxy Server IP
Hides your real IP, but reveals to the Access object that you are using a proxy server to access them.
Iv. use of deceptive proxy servers: Distorting Proxies
REMOTE_ADDR = Proxy Server IP
Http_via = proxy IP ( supplemental: This field is populated by a proxy server, sometimes populating gateway information, etc. )
Http_x_forwarded_for = Random IP
Tells the Access object that you used a proxy server, but fabricated a bogus random IP to spoof it instead of your real IP.
v. Use of high anonymous proxy servers: High Anonymity Proxies
REMOTE_ADDR = Proxy Server IP
Http_via = no value or no display
Http_x_forwarded_for = no value or no display
Full use of Proxy server information replaces all of your information, as if you were using the proxy server directly to access the object.
In addition, the proxy judges can be used to summarize other reference information, once again in practice.
Finally write a php example, for your reference only:
if (!empty ($_server[' Http_via '))//using a proxy
{
if (!isset ($_server[' http_x_forwarded_for '))
{
Anonymous Proxies normal Anonymous proxy server
Proxy IP address is $_server[' REMOTE_ADDR ']
}
Else
{
Transparent Proxies Transparent proxy Server
Proxy IP address is $_server[' REMOTE_ADDR ']
The real IP address is $_server[' http_x_forwarded_for ']
}
}
else//no agent or High anonymous proxy
{
The real IP address is $_server[' REMOTE_ADDR ']
}
Determine whether a client uses a proxy server and its anonymous level