怎么识别用户是通过代理访问网站的


网站的一个功能是要限制地区的,怎么简单地识别用户是通过http代理、VPN等措施访问的网站?

代理

kukul 10 years, 2 months ago

跟踪TCP包信息也许能做到。

marsh元素 answered 10 years, 2 months ago

没法识别,所有http头部信息都是可以篡改的

kofss answered 10 years, 2 months ago


 /**
 * 是否使用了代理?
 *
 * @return  boolean
 */
function is_use_proxy()
{
    $via = getenv("HTTP_VIA"); 
    $forwarded_for = getenv("HTTP_X_FORWARDED_FOR"); 
    $xroxy_connection = getenv("HTTP_XROXY_CONNECTION"); 
    $pragma = getenv("HTTP_PRAGMA"); 

    return ($via == "") 
            && ($forwarded_for == "") 
            && ($xroxy_connection == "") 
            && ($pragma == "");
}

秀吉我的菜 answered 10 years, 2 months ago

Your Answer