{"id":2823,"date":"2016-08-11T10:21:19","date_gmt":"2016-08-11T02:21:19","guid":{"rendered":"http:\/\/ixyzero.com\/blog\/?p=2823"},"modified":"2016-08-11T10:21:19","modified_gmt":"2016-08-11T02:21:19","slug":"%e5%9c%a8wget%e5%92%8ccurl%e4%b8%ad%e3%80%8c%e4%b8%8d%e3%80%8d%e4%bd%bf%e7%94%a8%e4%bb%a3%e7%90%86","status":"publish","type":"post","link":"https:\/\/ixyzero.com\/blog\/archives\/2823.html","title":{"rendered":"\u5728wget\u548ccurl\u4e2d\u300c\u4e0d\u300d\u4f7f\u7528\u4ee3\u7406"},"content":{"rendered":"<p>=Start=<\/p>\n<h5>\u7f18\u7531\uff1a<\/h5>\n<p>\u4e4b\u524d\u5728\u535a\u5ba2\u4e2d\u5199\u8fc7\u4e00\u7bc7\u6587\u7ae0\u300c<a href=\"http:\/\/ixyzero.com\/blog\/archives\/2664.html\" target=\"_blank\">\u5728wget\u548ccurl\u4e2d\u4f7f\u7528\u4ee3\u7406<\/a>\u300d\uff0c\u91cc\u9762\u8bf4\u4e86\u5982\u4f55\u5728wget\/curl\u547d\u4ee4\u4e2d\u4f7f\u7528\u4ee3\u7406\u8fdb\u884c\u4e0b\u8f7d\u3001\u8bbf\u95ee\u64cd\u4f5c\uff1b\u540e\u6765\u53c8\u770b\u5230\u4e00\u7bc7\u6587\u7ae0\u8bb2\u7684\u662f\u5982\u4f55\u8bbe\u7f6ewget\u5728\u9047\u5230\u67d0\u4e9bIP\/\u57df\u540d\u65f6\u4e0d\u4f7f\u7528\u4ee3\u7406\uff0c\u81ea\u5df1\u642d\u5efa\u73af\u5883\u5b9e\u9645\u6d4b\u8bd5\u4e86\u4e00\u4e0bwget\u548ccurl\uff0c\u5728\u6b64\u8bb0\u5f55\u4e00\u4e0b\u7ed3\u8bba\u548c\u5927\u4f53\u8fc7\u7a0b\uff0c\u65b9\u4fbf\u5176\u5b83\u4eba\u53c2\u8003\u3002<\/p>\n<h5>\u6b63\u6587\uff1a<\/h5>\n<h6>0.<span style=\"color: #0000ff;\">\u5148\u653e\u7ed3\u8bba<\/span><\/h6>\n<ul>\n<li><span style=\"color: #ff0000;\"><strong>wget\u4e0ano_proxy\u8fd9\u4e2a\u53d8\u91cf\u9700\u8981\u662f\u300c\u9017\u53f7\u5206\u9694\u300d(\u5355\u4e2aIP\/\u57df\u540d\u9664\u5916)\u7684\u300c\u57df\u540d \u6216 \u5177\u4f53IP\u300d\uff08\u4e0d\u80fd\u662fCIDR\u683c\u5f0f\u7684IP\u6bb5\uff09<\/strong><\/span><br \/>\n<span style=\"color: #0000ff;\">\u53e6\u5916\u5c31\u53ea\u80fd\u901a\u8fc7\u300c<code>--no-proxy<\/code>\u300d\u9009\u9879\u6765\u63a7\u5236\u6240\u6709\u7684\u57df\u540d\/IP\u65f6\u90fd\u4e0d\u8d70\u4ee3\u7406<\/span><\/li>\n<li><span style=\"color: #ff0000;\">curl\u4e0a\u53ea\u80fd\u901a\u8fc7\u300c<code>--noproxy<\/code>\u300d\u9009\u9879\u6765\u63a7\u5236\u5728\u78b0\u5230\u67d0\u4e9bIP\/\u57df\u540d\u65f6\u4e0d\u8d70\u4ee3\u7406<\/span><br \/>\n<span style=\"color: #0000ff;\">NO_PROXY\u53d8\u91cf\u6d4b\u8bd5\u4e0d\u6210\u529f<\/span>\uff08\u4e0d\u8bba\u662f\u5c06\u5176\u8bbe\u7f6e\u4e3a\u5177\u4f53\u7684IP\u8fd8\u662f\u5c06\u5176\u8bbe\u7f6e\u4e3a\u300c*\u300d\uff09<\/li>\n<\/ul>\n<h6>1.\u5982\u4f55\u642d\u5efa\u6d4b\u8bd5\u73af\u5883\uff1f<\/h6>\n<p>\u5728\u670d\u52a1\u5668A(10.10.41.171)\u4e0a\u542f\u52a8\u4e00\u4e2aApache\u670d\u52a1\uff0c\u5728\u670d\u52a1\u5668B(10.10.41.203)\u4e0a\u642d\u5efa\u4e00\u4e2aHTTP\u4ee3\u7406\uff0c\u5728\u670d\u52a1\u5668C(10.10.41.170)\u4e0a\u4f7f\u7528`wget\/curl`\u547d\u4ee4\u8fdb\u884c\u6d4b\u8bd5\u3002<\/p>\n<h6>2.\u6d4b\u8bd5\u8fc7\u7a0b<\/h6>\n<pre class=\"lang:default decode:true \">\u5728\u670d\u52a1\u5668B\u4e0a\u642d\u5efa\u7684\u4ee3\u7406\u5217\u8868\uff1a\n10.10.41.203:8001\n10.10.41.203:8002\n\n\u5728\u670d\u52a1\u5668A(10.10.41.171)\u4e0a\u6839\u636e\u8bbf\u95ee\u65e5\u5fd7\u5224\u65ad\u4ee3\u7406\u662f\u5426\u751f\u6548\uff1a\ntail -f \/var\/log\/httpd\/access_log\n\n\u4e0b\u9762\u8bb0\u5f55\u7684\u90fd\u662f\u5728\u670d\u52a1\u5668C(10.10.41.170)\u4e0a\u8fdb\u884c\u64cd\u4f5c\uff1a\n\n#\u76f4\u63a5\u8bbf\u95ee\ncurl -I http:\/\/10.10.41.171\n\n#\u901a\u8fc7\u4ee3\u7406\u8bbf\u95ee\ncurl -x 10.10.41.203:8001 -I http:\/\/10.10.41.171\n\n#\u5c06\u4ee3\u7406\u5199\u5165\u73af\u5883\u53d8\u91cf\u7136\u540e\u6d4b\u8bd5\nexport http_proxy=\"http:\/\/10.10.41.203:8001\"\ncurl -I http:\/\/10.10.41.171\nwget http:\/\/10.10.41.171\n\n#\u5c06\u975e\u4ee3\u7406\u5217\u8868\u5199\u5165\u73af\u5883\u53d8\u91cf\u7136\u540e\u6d4b\u8bd5wget\nexport no_proxy=\"10.10.41.171,10.10.41.135\" #\u751f\u6548\nwget http:\/\/10.10.41.171\n\nexport no_proxy=\"10.10.41.171\/30\"   #\u4e0d\u751f\u6548\nwget http:\/\/10.10.41.171\n\nwget http:\/\/10.10.41.171 --no-proxy     #\u751f\u6548\n\n\n#\u5c06\u975e\u4ee3\u7406\u5217\u8868\u5199\u5165\u73af\u5883\u53d8\u91cf\u7136\u540e\u6d4b\u8bd5curl\ncurl -I http:\/\/10.10.41.171 --noproxy \"10.10.41.171,10.10.37.135\"   #\u751f\u6548\ncurl -I http:\/\/10.10.41.171 --noproxy \"*\"   #\u751f\u6548\n\nexport NO_PROXY=\"10.10.41.171,10.10.37.135\" #\u4e0d\u751f\u6548\ncurl -I http:\/\/10.10.41.171\n\nexport NO_PROXY=\"10.10.41.171\" #\u4e0d\u751f\u6548\ncurl -I http:\/\/10.10.41.171\n\nexport NO_PROXY=\"*\" #\u4e0d\u751f\u6548\ncurl -I http:\/\/10.10.41.171<\/pre>\n<pre class=\"lang:default decode:true\">#\u5feb\u901f\u4e3a`no_proxy`\u53d8\u91cf\u8d4b\u503c\u4e3a\u7f51\u6bb5\u5217\u8868(10.1.1.1\/16)\nprintf -v no_proxy '%s,' 10.1.{1..255}.{1..255}\nexport no_proxy=\"${no_proxy%,}\"\n#\u6216\nexport no_proxy=\"$(echo 10.1.{1..255}.{1..255} | tr ' ' ',')\"<\/pre>\n<h5>\u53c2\u8003\u94fe\u63a5\uff1a<\/h5>\n<ul>\n<li><a href=\"http:\/\/unix.stackexchange.com\/questions\/23452\/set-a-network-range-in-the-no-proxy-environment-variable\">http:\/\/unix.stackexchange.com\/questions\/23452\/set-a-network-range-in-the-no-proxy-environment-variable<\/a><\/li>\n<li><a href=\"http:\/\/serverfault.com\/questions\/623543\/centos-6-5-proxy-bypass-no-proxy-not-working\">http:\/\/serverfault.com\/questions\/623543\/centos-6-5-proxy-bypass-no-proxy-not-working<\/a><\/li>\n<li>man wget<\/li>\n<li>man curl<\/li>\n<\/ul>\n<p>=END=<\/p>\n","protected":false},"excerpt":{"rendered":"<p>=Start= \u7f18\u7531\uff1a \u4e4b\u524d\u5728\u535a\u5ba2\u4e2d\u5199\u8fc7\u4e00\u7bc7\u6587\u7ae0\u300c\u5728wget\u548ccurl\u4e2d\u4f7f\u7528\u4ee3\u7406\u300d\uff0c\u91cc\u9762\u8bf4\u4e86\u5982\u4f55\u5728wget\/c [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23,11,12],"tags":[84,128,66],"class_list":["post-2823","post","type-post","status-publish","format-standard","hentry","category-knowledgebase-2","category-linux","category-tools","tag-curl","tag-proxy","tag-wget"],"views":13520,"_links":{"self":[{"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/posts\/2823","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/comments?post=2823"}],"version-history":[{"count":0,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/posts\/2823\/revisions"}],"wp:attachment":[{"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/media?parent=2823"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/categories?post=2823"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/tags?post=2823"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}