{"id":72,"date":"2023-04-30T15:50:04","date_gmt":"2023-04-30T15:50:04","guid":{"rendered":"http:\/\/nas.94i.top\/wordpress\/?p=72"},"modified":"2023-04-30T15:50:04","modified_gmt":"2023-04-30T15:50:04","slug":"%e9%9d%92%e9%be%99%e9%9d%a2%e6%9d%bf%e6%9b%b4%e6%8d%a2ip%e4%bb%a3%e7%90%86","status":"publish","type":"post","link":"https:\/\/www.94i.top\/index.php\/2023\/04\/30\/%e9%9d%92%e9%be%99%e9%9d%a2%e6%9d%bf%e6%9b%b4%e6%8d%a2ip%e4%bb%a3%e7%90%86\/","title":{"rendered":"\u9752\u9f99\u9762\u677f\u66f4\u6362ip\u4ee3\u7406"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">\u4e00\u3001\u642d\u5efa\u4ee3\u7406\u6c60<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">1.\u521b\u5efa\u5e76\u8fd0\u884c\u4ee3\u7406\u6c60docker<\/h3>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism undefined-numbers lang-bash\" data-lang=\"Bash\"><code>docker run -dit \\\n--name dailichi \\\n--hostname auto-proxy-pool \\\n--network bridge \\\n--restart always \\\n-p 18888:18888 \\\n-v \/root\/auto-proxy-pool:\/run\/data \\\n--privileged=true \\\nmzzsfy\/auto-proxy-pool:latest<\/code><\/pre><\/div>\n\n\n\n<p><strong>\u66f4\u65b0\u5bb9\u5668\u547d\u4ee4<\/strong>\uff08\u901a\u7528\uff0c\u6539\u5bb9\u5668\u540d\uff09<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism undefined-numbers lang-bash\" data-lang=\"Bash\"><code>docker run --rm     -v \/var\/run\/docker.sock:\/var\/run\/docker.sock     containrrr\/watchtower -c     --run-once dailichi<\/code><\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">2.\u914d\u7f6eproxy.yml\u6587\u4ef6<\/h3>\n\n\n\n<p>\u8fd0\u884c\u540eroot\/auto_proxy_pool\u4f1a\u751f\u6210proxy.template.yml\u6587\u4ef6(\u8be5\u6587\u4ef6\u6bcf\u6b21\u91cd\u542f\u90fd\u4f1a\u88ab\u8986\u76d6)<br>\u5c06\u6587\u4ef6\u6539\u540d\u4e3aproxy.yml,\u590d\u5236\u4e0b\u65b9\u4ee3\u7801\u66ff\u6362\u6240\u6709\uff1b+.xxx.com\u91cc\u9762\u7684xxx\u6539\u6210\u9700\u8981\u8fdb\u884c\u4ee3\u7406\u7684\u57df\u540d\u6bd4\u5982jd\u4e3a .+.jd.com<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism undefined-numbers lang-plain\"><code>changeRequest:\n  - hostRegex: (.+\\.jd\\.com)|(.+\\.isvjd\\.com)|(.+\\.isvjcloud\\.com) #\u6b63\u5219\u8868\u8fbe\u5f0f\n    proxy: proxy\nupstream:\n  proxy: #\u81ea\u5b9a\u4e49\u540d\u5b57\n    template: &#39;{{$x := regexFindAll &quot;\\\\d{1,3}(\\\\.\\\\d{1,3}){3}:\\\\d{2,5}&quot; . -1}}{{range $s := $x}}{{printf &quot;http:\/\/%s&quot; $s}}{{end}}&#39;\n    apiUrl:  #\u8fd9\u91cc\u662f\u586b\u5199\u4ee3\u7406api\u5730\u5740,\u683c\u5f0f\uff1atxt,\u6362\u884c\\n,\u63d0\u53d61\u4e2a\n    checkRetryNumber: 2 #\u68c0\u6d4b\u4ee3\u7406\u6b21\u6570\uff0c\u8d85\u8fc7\u6b21\u6570\u5219\u83b7\u53d6\u65b0\u4ee3\u7406\n    apiRetryNumber: 5 #\u4e0a\u6e38\u91cd\u8bd5\u6b21\u6570\uff0c\u8d85\u8fc7\u6b21\u6570\u5219\u91c7\u7528\u76f4\u8fde\n    checkUrl: http:\/\/jd.com\/,http:\/\/baidu.com\/,http:\/\/bilibili.com\/ #\u68c0\u6d4b\u4ee3\u7406\u662f\u5426\u6709\u6548\uff0c\u4e0d\u7528\u6539\n    lifecycle: -1 #\u81ea\u52a8\u5931\u6548\u65f6\u95f4\uff0c-1\u4e3a\u4e0d\u81ea\u52a8\u5931\u6548\uff0c\u5355\u4f4d\u79d2\n    maxSize: 5 #\u4fdd\u7559\u51e0\u4e2a\u4e0a\u6e38\n    checkTimeout: 2s #\u5355\u4e2acheck\u8d85\u65f6\u65f6\u95f4\n    checkRetryWait: 500ms #\u91cd\u8bd5check\u524d\u7b49\u5f85\u65f6\u95f4\n    requestInterval: 1000ms #\u8bf7\u6c42\u65f6\u95f4\u95f4\u9694\uff0c\u5728\u8fd9\u4e2a\u65f6\u95f4\u5185\u53ea\u4f1a\u8bf7\u6c42\u4e00\u6b21api<\/code><\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">3.\u8d2d\u4e70\u4ee3\u7406<\/h3>\n\n\n\n<p>\u63d0\u4f9b\u4e00\u4e2a\u4ee3\u7406\u8d2d\u4e70\u5730\u5740\uff1a<br><a href=\"http:\/\/www.xkdaili.com\/?ic=5a5seq9s\">\u661f\u7a7a\u4ee3\u7406<\/a> \u6bcf\u65e5\u7b7e\u5230\u9001 100 IP\u3002<br>\u8fdb\u5165-\u8ba2\u5355\u7ba1\u7406-API\u63d0\u53d6\/\u751f\u6210API-\u751f\u6210API\u94fe\u63a5-\u590d\u5236\u751f\u6210\u540e\u7684API\u94fe\u63a5\u586b\u5165\u914d\u7f6e\u6587\u4ef6proxy.yml\u7684apiUrl\u7684\u5192\u53f7\u540e\u9762\u3002<br>\u63d0\u53d6\u683c\u5f0f\u5982\u4e0b\uff1a<br>api\u4ee3\u7406\u83b7\u53d6\u8bbe\u7f6e\uff1a<br>\u8bfb\u53d6\u6570\u91cf\u9009\u62e9\uff1a 1<br>\u8bfb\u53d6\u683c\u5f0f\uff1atxt<br>\u5206 \u9694 \u7b26\uff1a\u6362\u884c(\\n)<br>\u914d\u7f6e\u597d\u540e\u91cd\u542f\u5373\u53ef<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e8c\u3001\u9752\u9f99\u914d\u7f6e\u4ee3\u7406<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">1.javascript\u8bbe\u7f6e\u4ee3\u7406<\/h3>\n\n\n\n<p>JavaScript\u811a\u672c\u5e76\u4e0d\u50cfPython\u90a3\u6837\u9ed8\u8ba4\u4f7f\u7528\u7cfb\u7edf\u4ee3\u7406\u53d8\u91cf\uff0c\u5982\u679c\u9700\u8981\u4f7f\u7528\u4ee3\u7406\u8fdb\u884c\u8bf7\u6c42\uff0c\u90a3\u53ea\u80fd\u5728\u4ee3\u7801\u4e2d\u8bbe\u7f6e\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">1.1nodejs\u4e2d\u5b89\u88c5global-agent\u4f9d\u8d56<\/h4>\n\n\n\n<h4 class=\"wp-block-heading\">1.2\u5c40\u90e8\u4ee3\u7406<\/h4>\n\n\n\n<p>\u5728\u9700\u8981\u7528\u4ee3\u7406\u7684js\u811a\u672c\u5f00\u5934\u52a0\u5165\u4e00\u884c\u4ee3\u7801<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism undefined-numbers lang-js\" data-lang=\"JavaScript\"><code>require(&#39;global-agent\/bootstrap&#39;);\nglobal.GLOBAL_AGENT.HTTP_PROXY=&quot;http:\/\/ip:port&quot;;<\/code><\/pre><\/div>\n\n\n\n<p>1.3\u5168\u5c40\u4ee3\u7406<\/p>\n\n\n\n<p>\u6211\u4eec\u53ea\u9700\u8981\u5728\u9752\u9f99\u7684config.sh\u6587\u4ef6\u6dfb\u52a0GLOBAL_AGENT_HTTP_PROXY\u3001GLOBAL_AGENT_HTTPS_PROXY\u73af\u5883\u53d8\u91cf\u5373\u53ef\uff1a<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism undefined-numbers lang-plain\" data-file=\"config.sh\"><code>\/\/\u4ec5\u652f\u6301http\u4ee3\u7406\nexport GLOBAL_AGENT_HTTP_PROXY=&quot;http:\/\/ip:port&quot;\n\/\/\u652f\u6301http\u548chttps\u4ee3\u7406\nexport GLOBAL_AGENT_HTTPS_PROXY=&quot;http:\/\/ip:port&quot;<\/code><\/pre><\/div>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u3001\u642d\u5efa\u4ee3\u7406\u6c60 1.\u521b\u5efa\u5e76\u8fd0\u884c\u4ee3\u7406\u6c60docker \u66f4\u65b0\u5bb9\u5668\u547d\u4ee4\uff08\u901a\u7528\uff0c\u6539\u5bb9\u5668\u540d\uff09 2.\u914d\u7f6eproxy.yml\u6587 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-72","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.94i.top\/index.php\/wp-json\/wp\/v2\/posts\/72","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.94i.top\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.94i.top\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.94i.top\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.94i.top\/index.php\/wp-json\/wp\/v2\/comments?post=72"}],"version-history":[{"count":0,"href":"https:\/\/www.94i.top\/index.php\/wp-json\/wp\/v2\/posts\/72\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.94i.top\/index.php\/wp-json\/wp\/v2\/media?parent=72"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.94i.top\/index.php\/wp-json\/wp\/v2\/categories?post=72"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.94i.top\/index.php\/wp-json\/wp\/v2\/tags?post=72"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}