{"id":1413,"date":"2012-02-10T08:55:04","date_gmt":"2012-02-10T00:55:04","guid":{"rendered":"http:\/\/doophp.sinaapp.com\/?p=1413"},"modified":"2012-02-10T08:55:04","modified_gmt":"2012-02-10T00:55:04","slug":"get-client-ip","status":"publish","type":"post","link":"https:\/\/blog.vimge.com\/archives\/php\/get-client-ip.html","title":{"rendered":"\u83b7\u53d6\u5ba2\u6237IP\u73af\u5883\u53d8\u91cf\uff1aHTTP_X_FORWARDED_FOR, HTTP_VIA and REMOTE_ADDR"},"content":{"rendered":"
\u6839\u636e\u4e0d\u540c\u7684\u8bbf\u95ee\u60c5\u51b5\uff0cPHP\u63d0\u4f9b\u51e0\u4e2a\u4e0d\u540c\u7684\u73af\u5883\u53d8\u91cf\u7528\u4e8e\u83b7\u53d6\u5ba2\u6237\u7aefIP\uff1a<\/p>\n
\u5b83\u4eec\u7684\u4e3b\u8981\u533a\u522b\u5728\u4e8e\uff0c\u7528\u6237\u5728\u8bbf\u95ee\u7f51\u7ad9\u7684\u65f6\u5019\u662f\u5426\u4f7f\u7528\u4e86\u4ee3\u7406\u670d\u52a1\u5668\uff0c\u4ee5\u53ca\u4f7f\u7528\u4f55\u79cd\u4ee3\u7406\u670d\u52a1\u3002<\/p>\n
\u4e00\u3001\u6ca1\u6709\u4f7f\u7528\u4ee3\u7406\u670d\u52a1\u5668\u7684\u60c5\u51b5\uff1a<\/strong><\/p>\n REMOTE_ADDR = \u60a8\u7684 IP<\/p>\n HTTP_VIA = \u6ca1\u6570\u503c\u6216\u4e0d\u663e\u793a<\/p>\n HTTP_X_FORWARDED_FOR = \u6ca1\u6570\u503c\u6216\u4e0d\u663e\u793a<\/p>\n \u4e8c\u3001\u4f7f\u7528\u900f\u660e\u4ee3\u7406\u670d\u52a1\u5668\u7684\u60c5\u51b5\uff1aTransparent Proxies<\/strong><\/p>\n REMOTE_ADDR = \u6700\u540e\u4e00\u4e2a\u4ee3\u7406\u670d\u52a1\u5668 IP<\/p>\n HTTP_VIA = \u4ee3\u7406\u670d\u52a1\u5668 IP<\/p>\n HTTP_X_FORWARDED_FOR = \u60a8\u7684\u771f\u5b9e IP \uff0c\u7ecf\u8fc7\u591a\u4e2a\u4ee3\u7406\u670d\u52a1\u5668\u65f6\uff0c\u8fd9\u4e2a\u503c\u7c7b\u4f3c\u5982\u4e0b\uff1a203.98.182.163, 203.98.182.163, 203.129.72.215\u3002<\/p>\n \u8fd9\u7c7b\u4ee3\u7406\u670d\u52a1\u5668\u8fd8\u662f\u5c06\u60a8\u7684\u4fe1\u606f\u8f6c\u53d1\u7ed9\u60a8\u7684\u8bbf\u95ee\u5bf9\u8c61\uff0c\u65e0\u6cd5\u8fbe\u5230\u9690\u85cf\u771f\u5b9e\u8eab\u4efd\u7684\u76ee\u7684\u3002<\/p>\n \u4e09\u3001\u4f7f\u7528\u666e\u901a\u533f\u540d\u4ee3\u7406\u670d\u52a1\u5668\u7684\u60c5\u51b5\uff1aAnonymous Proxies<\/strong><\/p>\n REMOTE_ADDR = \u6700\u540e\u4e00\u4e2a\u4ee3\u7406\u670d\u52a1\u5668 IP<\/p>\n HTTP_VIA = \u4ee3\u7406\u670d\u52a1\u5668 IP<\/p>\n HTTP_X_FORWARDED_FOR = \u4ee3\u7406\u670d\u52a1\u5668 IP \uff0c\u7ecf\u8fc7\u591a\u4e2a\u4ee3\u7406\u670d\u52a1\u5668\u65f6\uff0c\u8fd9\u4e2a\u503c\u7c7b\u4f3c\u5982\u4e0b\uff1a203.98.182.163, 203.98.182.163, 203.129.72.215\u3002<\/p>\n \u9690\u85cf\u4e86\u60a8\u7684\u771f\u5b9eIP\uff0c\u4f46\u662f\u5411\u8bbf\u95ee\u5bf9\u8c61\u900f\u9732\u4e86\u60a8\u662f\u4f7f\u7528\u4ee3\u7406\u670d\u52a1\u5668\u8bbf\u95ee\u4ed6\u4eec\u7684\u3002<\/p>\n \u56db\u3001\u4f7f\u7528\u6b3a\u9a97\u6027\u4ee3\u7406\u670d\u52a1\u5668\u7684\u60c5\u51b5\uff1aDistorting Proxies<\/strong><\/p>\n REMOTE_ADDR = \u4ee3\u7406\u670d\u52a1\u5668 IP<\/p>\n HTTP_VIA = \u4ee3\u7406\u670d\u52a1\u5668 IP<\/p>\n HTTP_X_FORWARDED_FOR = \u968f\u673a\u7684 IP \uff0c\u7ecf\u8fc7\u591a\u4e2a\u4ee3\u7406\u670d\u52a1\u5668\u65f6\uff0c\u8fd9\u4e2a\u503c\u7c7b\u4f3c\u5982\u4e0b\uff1a203.98.182.163, 203.98.182.163, 203.129.72.215\u3002<\/p>\n \u544a\u8bc9\u4e86\u8bbf\u95ee\u5bf9\u8c61\u60a8\u4f7f\u7528\u4e86\u4ee3\u7406\u670d\u52a1\u5668\uff0c\u4f46\u7f16\u9020\u4e86\u4e00\u4e2a\u865a\u5047\u7684\u968f\u673aIP\u4ee3\u66ff\u60a8\u7684\u771f\u5b9eIP\u6b3a\u9a97\u5b83\u3002<\/p>\n \u4e94\u3001\u4f7f\u7528\u9ad8\u533f\u540d\u4ee3\u7406\u670d\u52a1\u5668\u7684\u60c5\u51b5\uff1aHigh Anonymity Proxies (Elite proxies)<\/strong><\/p>\n REMOTE_ADDR = \u4ee3\u7406\u670d\u52a1\u5668 IP<\/p>\n HTTP_VIA = \u6ca1\u6570\u503c\u6216\u4e0d\u663e\u793a<\/p>\n HTTP_X_FORWARDED_FOR = \u6ca1\u6570\u503c\u6216\u4e0d\u663e\u793a \uff0c\u7ecf\u8fc7\u591a\u4e2a\u4ee3\u7406\u670d\u52a1\u5668\u65f6\uff0c\u8fd9\u4e2a\u503c\u7c7b\u4f3c\u5982\u4e0b\uff1a203.98.182.163, 203.98.182.163, 203.129.72.215\u3002<\/p>\n \u5b8c\u5168\u7528\u4ee3\u7406\u670d\u52a1\u5668\u7684\u4fe1\u606f\u66ff\u4ee3\u4e86\u60a8\u7684\u6240\u6709\u4fe1\u606f\uff0c\u5c31\u8c61\u60a8\u5c31\u662f\u5b8c\u5168\u4f7f\u7528\u90a3\u53f0\u4ee3\u7406\u670d\u52a1\u5668\u76f4\u63a5\u8bbf\u95ee\u5bf9\u8c61\u3002 \u6839\u636e\u4e0d\u540c\u7684\u8bbf\u95ee\u60c5\u51b5\uff0cPHP\u63d0\u4f9b\u51e0\u4e2a\u4e0d\u540c\u7684\u73af\u5883\u53d8\u91cf\u7528\u4e8e\u83b7\u53d6\u5ba2\u6237\u7aefIP\uff1a REMOTE_ADDR HTTP_VIA […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[9],"tags":[45,47,46],"_links":{"self":[{"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/posts\/1413"}],"collection":[{"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/comments?post=1413"}],"version-history":[{"count":1,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/posts\/1413\/revisions"}],"predecessor-version":[{"id":1414,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/posts\/1413\/revisions\/1414"}],"wp:attachment":[{"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/media?parent=1413"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/categories?post=1413"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/tags?post=1413"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}
\n\u53c2\u8003\u8d44\u6599\uff1a<\/strong><\/p>\n\n