{"id":4616,"date":"2018-06-03T03:57:51","date_gmt":"2018-06-02T19:57:51","guid":{"rendered":"http:\/\/4563.org\/?p=4616"},"modified":"2018-06-07T03:58:18","modified_gmt":"2018-06-06T19:58:18","slug":"centos-7-%e6%90%ad%e5%bb%ba-tinyproxy-%e4%bb%a3%e7%90%86","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=4616","title":{"rendered":"CentOS 7 \u642d\u5efa TinyProxy \u4ee3\u7406"},"content":{"rendered":"<p>TinyProxy\u00a0\u548c Squid \u90fd\u662f\u6bd4\u8f83\u4f18\u79c0\u7684\u4ee3\u7406\u8f6f\u4ef6<\/p>\n<p>TinyProxy\u6bd4\u8f83\u5c0f\u4f17\uff0c\u867d\u7136\u6ca1\u6709Squid\u7684\u529f\u80fd\u4e30\u5bcc\uff0c\u4f46\u662f\u5c0f\u5de7\u7b80\u5355\uff0c\u4e5f\u80fd\u6ee1\u8db3\u666e\u901a\u7528\u6237\u7684\u9700\u6c42\u3002<\/p>\n<p>Squid\u00a0\u662f\u4e00\u6b3e\u4f18\u79c0\u7684\u4ee3\u7406\u8f6f\u4ef6\uff0c\u6709\u5f88\u4e30\u5bcc\u7684ACL\u7ba1\u7406\u529f\u80fd\uff0c\u867d\u7136squid\u5f88\u5f3a\u5927\uff0c\u4f46\u914d\u7f6e\u6bd4\u8f83\u7e41\u7410\u3002<\/p>\n<p>&nbsp;<\/p>\n<p><strong>1. \u5b89\u88c5\u00a0TinyProxy<\/strong><\/p>\n<p>yum -y install tinyproxy<\/p>\n<p>&nbsp;<\/p>\n<p><strong>2. \u914d\u7f6e\u00a0TinyProxy<\/strong><\/p>\n<p>vim \/etc\/tinyproxy\/tinyproxy.conf<\/p>\n<p>\u4fee\u6539 Port \u7aef\u53e3\uff0c\u9ed8\u8ba4\u4e3a 8888<\/p>\n<p>Port 8888<\/p>\n<p>\u6ce8\u91ca\u6389 Allow\uff0c\u8868\u793a\u5141\u8bb8\u6240\u6709\u4eba\u8bbf\u95ee\u4ee3\u7406<\/p>\n<p>#Allow 127.0.0.1<\/p>\n<p>\u9690\u85cf\u6389Via\u8bf7\u6c42\u5934\u90e8\uff0c\u53bb\u6389\u4e0b\u9762\u7684\u6ce8\u91ca<\/p>\n<p>DisableViaHeader Yes<\/p>\n<p>\u66f4\u591a\u914d\u7f6e\u9879\uff0c\u4e0b\u9762\u662f\u5217\u4e3e\u4e00\u4e9b\u914d\u7f6e\u6587\u4ef6\u9ed8\u8ba4\u7684\uff0c\u4e0d\u9700\u8981\u914d\u7f6e\uff1a<\/p>\n<p>PidFile &#8220;\/var\/run\/tinyproxy\/tinyproxy.pid&#8221;<br \/>\nLogFile &#8220;\/var\/log\/tinyproxy\/tinyproxy.log&#8221;<br \/>\nLogLevel Info<br \/>\nMaxClients 100<br \/>\nMinSpareServers 5<br \/>\nMaxSpareServers 20<br \/>\nStartServers 10<\/p>\n<p>&nbsp;<\/p>\n<p><strong>3. \u542f\u52a8 TinyProxy<\/strong><\/p>\n<p>systemctl start tinyproxy.service<\/p>\n<p>\u66f4\u591a\u547d\u4ee4\u5982\u4e0b\uff1a<\/p>\n<p>systemctl restart tinyproxy.service<br \/>\nsystemctl stop tinyproxy.service<br \/>\nsystemctl status tinyproxy.service<br \/>\nsystemctl enable tinyproxy.service<\/p>\n<p>&nbsp;<\/p>\n<p><strong>4. \u5173\u95ed\u9632\u706b\u5899\u6216\u5f00\u653e\u7aef\u53e3\u8bbf\u95ee<\/strong><\/p>\n<p>\u65b9\u5f0f1\uff1a\u5173\u95ed\u9632\u706b\u5899<\/p>\n<p>\/etc\/init.d\/iptables stop<\/p>\n<p>\u65b9\u5f0f2\uff1a\u5f00\u653e\u7aef\u53e3\u8bbf\u95ee<\/p>\n<p>iptables -A INPUT -p tcp &#8211;dport 8888 -j ACCEPT<\/p>\n<p>\u91cd\u542f\u9632\u706b\u5899<\/p>\n<p>\/etc\/init.d\/iptables restart<\/p>\n<p>\u6ce8\u610f\uff1a\u82e5\u91c7\u7528\u7684\u963f\u91cc\u4e91\u3001\u817e\u8baf\u4e91\u3001AWS\u7b49\u4e91\u670d\u52a1\u5668\uff0c\u8bb0\u5f97\u8981\u5728\u5b89\u5168\u7b56\u7565\u91cc\u5f00\u653e\u7aef\u53e3\u53f7<\/p>\n<p>&nbsp;<\/p>\n<p><strong>5. \u9a8c\u8bc1\u751f\u6548<\/strong><\/p>\n<p>1\uff09\u547d\u4ee4\u884c\u6d4b\u8bd5\u9a8c\u8bc1<\/p>\n<p>curl \u548c wget \u6d4b\u8bd5\u4f7f\u7528\u4ee3\u7406\uff0c\u8bf7\u53c2\u8003<a href=\"https:\/\/proxy.mimvp.com\/demo2.php\" target=\"_blank\" rel=\"noopener\">\u7c73\u6251\u4ee3\u7406\u7684\u4f7f\u7528\u793a\u4f8b<\/a>\uff0c\u603b\u7ed3\u7684\u975e\u5e38\u5168\u9762\uff01\u5f3a\u70c8\u63a8\u8350\uff01<\/p>\n<p>\u8fd9\u91cc\uff0c\u76f4\u63a5\u4f7f\u7528\u7c73\u6251\u4ee3\u7406\u7684\u6700\u7b80\u5355\u793a\u4f8b\uff1a<\/p>\n<p>curl -m 30 &#8211;retry 3 -x http:\/\/58.87.90.149:8888 http:\/\/proxy.mimvp.com\/exist.php\u00a0| grep &#8216;color=&#8221;red&#8221;&#8216;<br \/>\n&lt;font color=&#8221;red&#8221;&gt;58.87.90.149&lt;\/font&gt;<br \/>\ncurl -m 30 &#8211;retry 3 -x http:\/\/58.87.90.149:8888 -k https:\/\/proxy.mimvp.com\/exist.php\u00a0| grep &#8216;color=&#8221;red&#8221;&#8216;<br \/>\n&lt;font color=&#8221;red&#8221;&gt;58.87.90.149&lt;\/font&gt;<\/p>\n<p>tinyproxy \u652f\u6301 http \u548c https \u4e24\u79cd\u534f\u8bae\uff0c\u7ecf\u7c73\u6251\u4ee3\u7406\u6d4b\u8bd5\uff0c\u6210\u529f\uff01<\/p>\n<p>&nbsp;<\/p>\n<p>2\uff09Firefox \u63d2\u4ef6\u6d4b\u8bd5<\/p>\n<p>\u9996\u5148\uff0c\u5b89\u88c5 Proxy Switcher<\/p>\n<p>\u5176\u6b21\uff0c\u914d\u7f6e\u4ee3\u7406\uff0c\u5982\u4e0b\u56fe\uff1a<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-4617\" src=\"http:\/\/4563.org\/wp-content\/uploads\/2018\/06\/1.png\" alt=\"\" width=\"539\" height=\"408\" \/><\/p>\n<p>\u7136\u540e\uff0c\u8bbf\u95ee\u7c73\u6251\u4ee3\u7406\u7f51\u7ad9\uff0c\u9a8c\u8bc1\u4ee3\u7406<\/p>\n<p><a href=\"https:\/\/proxy.mimvp.com\/exist.php\" target=\"_blank\" rel=\"noopener\">https:\/\/proxy.mimvp.com\/exist.php<\/a><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-4618\" src=\"http:\/\/4563.org\/wp-content\/uploads\/2018\/06\/2.png\" alt=\"\" width=\"409\" height=\"143\" \/><\/p>\n<p>\u4e0a\u56fe\u91cc\uff0chttp_via \u5e26\u6709\u53c2\u6570\uff0c\u8981\u9690\u85cf\u9700\u8981\u4fee\u6539\u914d\u7f6e\u6587\u4ef6<\/p>\n<p>vim \/etc\/tinyproxy\/tinyproxy.conf<\/p>\n<p>\u9690\u85cf\u6389Via\u8bf7\u6c42\u5934\u90e8\uff0c\u53bb\u6389\u4e0b\u9762\u7684\u6ce8\u91ca<\/p>\n<p>DisableViaHeader Yes<\/p>\n<p>\u91cd\u542f tinyproxy<\/p>\n<p>systemctl restart tinyproxy.service<\/p>\n<p>&nbsp;<\/p>\n<p>Credit:<a href=\"https:\/\/blog.csdn.net\/ithomer\/article\/details\/78220378\" target=\"_blank\" rel=\"noopener\">CSDN\u535a\u5ba2<\/a><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>TinyProxy\u00a0\u548c Squid&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/4616"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4616"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/4616\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4616"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4616"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4616"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}