To determine whether a client uses a proxy server, you can judge from the environment variable information sent by the client.
Specifically, look at the Http_via field, if this field is set, the client uses a proxy server.
Anonymous levels can be judged by reference to the table below.
Give an example of an application, you can put up a proxy test effect: http://ip.mixsec.org/
First, do not use 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 Server 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 will still be able to forward your information to your Access object, not to hide the real identity.
Third, the use of ordinary anonymous proxy server situation: Anonymous proxies
REMOTE_ADDR = Proxy Server IP
Http_via = Proxy Server 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 Server IP (supplemental: This field is populated by a proxy server, sometimes populating gateway information, etc.)
Http_x_forwarded_for = Random IP
Told the Access object that you used the proxy server, but fabricated a fake random IP instead of your real IP to deceive it.
V. Using a high anonymous proxy server: Gao anonymity proxies
REMOTE_ADDR = Proxy Server IP
Http_via = no value or no display
Http_x_forwarded_for = no value or no display
Completely replaces all your information with the proxy server's information, as if you were using that proxy server directly to access the object.
In addition, some other reference information can be summed up by proxy judges and used in practice.
Finally write a php example, for your reference only:
Copy Code code as follows:
if (!empty ($_server[' Http_via '))//using the agent
{
if (!isset ($_server[' http_x_forwarded_for '))
{
Anonymous proxies Common Anonymous proxy server
Proxy IP address is $_server[' REMOTE_ADDR ']
}
Else
{
Transparent proxies transparent proxy server
Proxy IP address is $_server[' REMOTE_ADDR ']
Real IP address is $_server[' http_x_forwarded_for ']
}
}
else//no agent or High anonymous agent
{
Real IP address is $_server[' REMOTE_ADDR ']
}