{"id":30,"date":"2022-06-29T09:35:08","date_gmt":"2022-06-29T01:35:08","guid":{"rendered":"http:\/\/blog.naspro.cc\/?p=30"},"modified":"2022-06-29T09:36:19","modified_gmt":"2022-06-29T01:36:19","slug":"docker%e7%89%88%e7%9a%84frp%e5%ae%a2%e6%88%b7%e7%ab%af%e9%85%8d%e7%bd%ae%e8%af%a6%e8%a7%a3","status":"publish","type":"post","link":"http:\/\/blog.naspro.cc\/?p=30","title":{"rendered":"DOCKER\u7248\u7684FRP\u5ba2\u6237\u7aef\u914d\u7f6e\u8be6\u89e3"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_73 counter-flat ez-toc-counter ez-toc-light-blue ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"http:\/\/blog.naspro.cc\/?p=30\/#%e9%85%8d%e7%bd%aefrpc\" title=\"\u914d\u7f6eFRPC\">\u914d\u7f6eFRPC<\/a><\/li><li class='ez-toc-page-1'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"http:\/\/blog.naspro.cc\/?p=30\/#%e9%85%8d%e7%bd%ae%e7%be%a4%e6%99%96docker\" title=\"\u914d\u7f6e\u7fa4\u6656Docker\">\u914d\u7f6e\u7fa4\u6656Docker<\/a><\/li><\/ul><\/nav><\/div>\n<h3><span class=\"ez-toc-section\" id=\"%e9%85%8d%e7%bd%aefrpc\"><\/span>\u914d\u7f6eFRPC<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>1.\u5728\u7fa4\u6656\u4e0a\u5efa\u7acb\u4e00\u4e2a\u6587\u4ef6\u5939\uff0c\u65b0\u5efa\u6587\u4ef6  frpc.ini \u5e76\u4e14\u914d\u7f6e\u8fd9\u4e2a\u6587\u4ef6\uff0c\u6bd4\u5982\u6211\u5efa\u7acb\u5728 \/volume1\/docker\/frpc\/conf\/frpc.ini<\/p>\n<p>\u914d\u7f6e\u6a21\u677f:<\/p>\n<pre class=\"prettyprint linenums\" ><code>[common]\nserver_addr = www.yourdomain.com \n#frps\u670d\u52a1\u7aef\u5730\u5740\nserver_port = 7000\n#frps\u670d\u52a1\u7aef\u901a\u8baf\u7aef\u53e3\uff0c\u5ba2\u6237\u7aef\u8fde\u63a5\u5230\u670d\u52a1\u7aef\u5185\u7f51\u7a7f\u900f\u4f20\u8f93\u6570\u636e\u7684\u7aef\u53e3\nprivilege_token = frp888\n#\u7279\u6743\u6a21\u5f0f\u5bc6\u94a5\uff0c\u5ba2\u6237\u7aef\u8fde\u63a5\u5230FRPS\u670d\u52a1\u7aef\u7684\u9a8c\u8bc1\u5bc6\u94a5\nlog_file = frpc.log\n#\u65e5\u5fd7\u5b58\u653e\u8def\u5f84\nlog_level = info\n#\u65e5\u5fd7\u8bb0\u5f55\u7c7b\u522b,\u53ef\u9009\uff1atrace, debug, info, warn, error\nlog_max_days = 7\n#\u65e5\u5fd7\u4fdd\u5b58\u5929\u6570\nlogin_fail_exit = false\n#\u8bbe\u7f6e\u4e3afalse\uff0cfrpc\u8fde\u63a5frps\u5931\u8d25\u540e\u91cd\u8fde\uff0c\u9ed8\u8ba4\u4e3atrue\u4e0d\u91cd\u8fde\nprotocol = kcp\n#KCP\u534f\u8bae\u5728\u5f31\u7f51\u73af\u5883\u4e0b\u4f20\u8f93\u6548\u7387\u63d0\u5347\u660e\u663e\u4f46\u662f\u5bf9frps\u4f1a\u6709\u4e00\u4e9b\u989d\u5916\u7684\u6d41\u91cf\u6d88\u8017\u3002\n\u670d\u52a1\u7aef\u987b\u5148\u8bbe\u7f6ekcp_bind_port = 7000\uff0cwww.yourdomain.com\u670d\u52a1\u7aef\u5df2\u8bbe\u7f6e\u652f\u6301\n\n[http_dsm]\n#\u7a7f\u900f\u670d\u52a1\u540d\u79f0,\u4e0d\u80fd\u548c\u5176\u4ed6\u5df2\u5efa\u7acb\u7684\u76f8\u540c\uff0c\u4f7f\u7528\u516c\u5171\u670d\u52a1\u5668\u7684\u5efa\u8bae\u4fee\u6539\u6210\u590d\u6742\u4e00\u70b9\u7684\u540d\u79f0\uff0c\u907f\u514d\u4e0e\u5176\u4ed6\u4eba\u51b2\u7a81\uff0c\u5f88\u591a\u8def\u7531\u5668\u5185\u7f6efrpc\u7684\u9ed8\u8ba4\u670d\u52a1\u540d\u79f0\u4e3a[web]\uff0c\u5f88\u5bb9\u6613\u5f88\u5176\u4ed6\u4eba\u51b2\u7a81\ntype = http\n#\u7a7f\u900f\u534f\u8bae\u7c7b\u578b\uff0c\u53ef\u9009\uff1atcp\uff0cudp\uff0chttp\uff0chttps\uff0cstcp\uff0cxtcp\uff0c\u8fd9\u4e2a\u8bbe\u7f6e\u4e4b\u524d\u5fc5\u987b\u81ea\u884c\u641e\u6e05\u695a\u5e94\u8be5\u662f\u4ec0\u4e48\nlocal_ip = 192.168.1.2\n#\u672c\u5730\u76d1\u542cIP\uff0c\u53ef\u4ee5\u662f\u672c\u673aIP\uff0c\u4e5f\u53ef\u4ee5\u662f\u672c\u5730\u7684\u5c40\u57df\u7f51\u5185\u67d0IP\uff0c\u4f8b\u5982\u4f60\u7684\u5c40\u57df\u7f51\u662f\u4e92\u901a\u7684\uff0c\u4f60\u53ef\u4ee5\u5728\u8def\u7531\u5668\u4e0a\u5b89\u88c5frpc\uff0c\u7136\u540elocal_ip\u586b\u7684\u5185\u7f51\u5176\u4ed6\u673a\u5668ip\uff0c\u8fd9\u6837\u4e5f\u53ef\u4ee5\u628a\u5185\u7f51\u5176\u4ed6\u673a\u5668\u7a7f\u900f\u51fa\u53bb\nlocal_port = 5000\n#\u672c\u5730\u76d1\u542c\u7aef\u53e3\uff0c\u901a\u5e38\u6709ssh\u7aef\u53e322\uff0c\u8fdc\u7a0b\u684c\u97623389\u7b49\u7b49\nuse_compression = true\n#\u5bf9\u4f20\u8f93\u5185\u5bb9\u8fdb\u884c\u538b\u7f29\uff0c\u53ef\u4ee5\u6709\u6548\u51cf\u5c0f frpc \u4e0e frps \u4e4b\u95f4\u7684\u7f51\u7edc\u6d41\u91cf\uff0c\u52a0\u5feb\u6d41\u91cf\u8f6c\u53d1\u901f\u5ea6\uff0c\u4f46\u662f\u4f1a\u989d\u5916\u6d88\u8017\u4e00\u4e9b cpu \u8d44\u6e90\nuse_encryption = true\n#\u5c06 frpc \u4e0e frps \u4e4b\u95f4\u7684\u901a\u4fe1\u5185\u5bb9\u52a0\u5bc6\u4f20\u8f93\ncustom_domains = dsm.yourdomain.com\n#\u81ea\u5b9a\u4e49\u57df\u540d\u8bbf\u95ee\u7a7f\u900f\u670d\u52a1\uff0c\u4e00\u822c\u57df\u540d\u8bbe\u7f6e\u4e86\u4e8c\u7ea7\u57df\u540d\u6cdb\u89e3\u6790\u4ee5\u540e\uff0c\u8fd9\u91cc\u586b*.yourdomain.com\u5373\u53ef\uff0c*\u81ea\u5b9a\u4e49\uff0c\u5982\u679c\u4e0d\u60f3\u7528\u57df\u540d\u6216\u8005\u81ea\u884c\u642d\u5efafrps\u6ca1\u6709\u57df\u540d\uff0c\u5219\u7a7f\u900f\u534f\u8bae\u7c7b\u578b\u9009\u62e9tcp\uff0c\u89c1\u4ee5\u4e0btcp\u90e8\u5206\u8be6\u89e3\n#\u901a\u8fc7app\u8bbf\u95ee\u7684\u6ce8\u610f\uff0cDS file,DS video,DS audio,DS finder\u91cc\u5730\u5740\u680f\u9ed8\u8ba4\u90fd\u662f5000\u7aef\u53e3\uff0c\u7a7f\u900f\u540e\u5730\u5740\u680f\u987b\u586b\u5199\u4e3a\u3010\u7a7f\u900f\u57df\u540d:80\u3011\uff0cDS photo\u7531\u4e8e\u672c\u5730local_port\u4e3a80\uff0c\u7a7f\u900f\u540e\u4e5f\u4e3a80\u7684\u8bdd\u76f4\u63a5\u5199\u57df\u540d\u5730\u5740\u5373\u53ef\n\n[https_dsm]\ntype = https\nlocal_ip = 192.168.1.2\nlocal_port = 5001\nuse_compression = true\nuse_encryption = true\ncustom_domains =  dsm.yourdomain.com\n#\u4ee5\u4e0ahttps\u914d\u7f6e\u540chttp\uff0c\u6ce8\u610f\u5f00\u542fhttps\uff08\u9ed8\u8ba45001\u7aef\u53e3\uff09\uff0c\u8bc1\u4e66\u914d\u7f6e\u5728\u5ba2\u6237\u7aef\uff0c\u65e0\u8bc1\u4e66\u7684\u6ce8\u610f\u6d4f\u89c8\u5668\u8bbf\u95ee\u65f6\u6dfb\u52a0\u4fe1\u4efb\n\n[http_transmission]\ntype = http\nlocal_ip = 192.168.1.2\nlocal_port = 9091\nuse_compression = true\nuse_encryption = true\ncustom_domains = tr.yourdomain.com\n#transmission\u4e0b\u8f7d\u5ba2\u6237\u7aef\n\n[http_rutorrent]\ntype = http\nlocal_ip = 192.168.1.2\nlocal_port = 80\nuse_compression = true\nuse_encryption = true\ncustom_domains = rt.yourdomain.com\n#rutorrent\u4e0b\u8f7d\u5ba2\u6237\u7aef\uff0c\u7528Download Station\u7684\u7c7b\u4f3c\uff0c\u6ce8\u610f\u7aef\u53e3\n\n[http_blog]\ntype = http\nlocal_ip = 192.168.1.2\nlocal_port = 80\nuse_compression = true\nuse_encryption = true\ncustom_domains = blog.yourdomain.co\n\n[http_plex]\ntype = http\nlocal_ip = 192.168.1.2\nlocal_port = 32400\nuse_compression = true\nuse_encryption = true\ncustom_domains = plex.yourdomain.com\n#plex\u89c6\u9891\u670d\u52a1\u5668\n\n[https_feixun]\nprivilege_mode = true\ntype = http\nlocal_ip = 192.168.1.1\n#\u8def\u7531\u5668ip\nlocal_port = 80\nuse_compression = true\nuse_encryption = true\nauthentication_timeout = 0\ncustom_domains = feixun.yourdomain.com\n#\u7a7f\u900f\u8def\u7531\u5668\n\n[tcp_ssh]\n#ssh\u8fde\u63a5\ntype = tcp\nlocal_ip = 192.168.1.2\nlocal_port = 22\nuse_compression = true\nuse_encryption = true\nremote_port = 3463\n#\u8fdc\u7a0b\u7aef\u53e3\uff0c\u4e00\u822ctcp\u548cudp\u9700\u8981\u8bbe\u7f6e\uff0c\u4e0d\u9700\u8981\u8bbe\u7f6ecustom_domain,\u8bbf\u95ee\u65f6\u4e3a\u3010frps\u670d\u52a1\u5668\u5730\u5740+\u8fdc\u7a0b\u7aef\u53e3\u3011\uff0c\u6ca1\u6709\u57df\u540d\u7684\u7528\u8fd9\u79cd\u65b9\u5f0f\u901a\u8fc7\u3010frps\u670d\u52a1\u5668\u5730\u5740+\u8fdc\u7a0b\u7aef\u53e3\u3011\u5373\u53ef\u5b9e\u73b0\u8bbf\u95ee\n\n[udp]\ntype = udp\nlocal_ip = 192.168.1.2\nlocal_port = 53\nuse_compression = true\nuse_encryption = true\nremote_port = 3453<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"%e9%85%8d%e7%bd%ae%e7%be%a4%e6%99%96docker\"><\/span>\u914d\u7f6e\u7fa4\u6656Docker<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>1.\u6253\u5f00\u7fa4\u6656Docker\uff0c\u9009\u62e9\u6ce8\u518c\u8868\uff0c\u641c\u7d22oldiy,\u6839\u636e\u4f60\u7684frps\u9009\u62e9\u4f60\u7684\u7fa4\u6656frpc\u7684docker\u7248\u672c<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/blog.naspro.cc\/wp-content\/uploads\/2022\/02\/1-51de80b096494128a9e96c1ee3ba8ba8.png\" alt=\"1\" \/><\/p>\n<p>\u5728\u9ad8\u7ea7\u8bbe\u7f6e\u4e2d\uff0c\u6dfb\u52a0\u542f\u52a8\u81ea\u52a8\u91cd\u542f<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/blog.naspro.cc\/wp-content\/uploads\/2022\/02\/2-2ee7953539914a5a97fe01291efbef3e.png\" alt=\"2\" \/><\/p>\n<p>\u88c5\u8f7d\u8def\u5f84 \/frp\/frpc.ini\uff08\u4e0d\u53ef\u4fee\u6539\uff09 \u6dfb\u52a0\u521a\u521a\u4fdd\u5b58\u7684frpc.ini\u6587\u4ef6 \u8def\u5f84<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/blog.naspro.cc\/wp-content\/uploads\/2022\/02\/3-d618f647d713473bb727d55d85228104.png\" alt=\"3\" \/><\/p>\n<p>\u6dfb\u52a0\u4f7f\u7528docke host \u76f8\u540c\u7f51\u7edc \u6700\u540e\u5e94\u7528\u786e\u5b9a<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/blog.naspro.cc\/wp-content\/uploads\/2022\/02\/4-378f027bbd2a4b69ae40d60a404ce198.png\" alt=\"4\" \/><\/p>\n<p>\u5982\u679c\u6ca1\u6709\u610f\u5916\u4f60\u53ef\u4ee5\u5916\u7f51\u8bbf\u95ee\u4e86\uff0c\u5982\u679c\u9700\u8981\u6dfb\u52a0\u65b0\u7684\u5185\u7f51\u670d\u52a1\uff0c\u76f4\u63a5\u7f16\u8f91\u672c\u673a\/volume1\/docker\/frpc\/conf\/frpc.ini\u7684\u914d\u7f6e\u6587\u4ef6\u5373\u53ef\uff01\u66f4\u6362\u670d\u52a1\u5668\u548c\u589e\u52a0\u90fd\u975e\u5e38\u65b9\u4fbf\uff01\u4fee\u6539\u540e\u91cd\u542f\u4e00\u4e0bdocker\u91cc \u5bb9\u5668\u91cc\u7684frpc\u5373\u53ef\uff01<\/p>\n<p>\u6ce8\u610f\uff1a\u670d\u52a1\u5668\u7aef\u7248\u672c\u8981\u4e0e\u5ba2\u6237\u7aef\u7248\u672c\u76f8\u540c\u624d\u53ef\u4ee5<\/p>\n<p>\u5173\u4e8eFRP GITHUP \u9879\u76ee\u5730\u5740:<a href=\"https:\/\/github.com\/fatedier\/frp\/blob\/master\/README_zh.md#%E8%BA%AB%E4%BB%BD%E9%AA%8C%E8%AF%81\">https:\/\/github.com\/fatedier\/frp\/blob\/master\/README_zh.md#%E8%BA%AB%E4%BB%BD%E9%AA%8C%E8%AF%81<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u914d\u7f6eFRPC 1.\u5728\u7fa4\u6656\u4e0a\u5efa\u7acb\u4e00\u4e2a\u6587\u4ef6\u5939\uff0c\u65b0\u5efa\u6587\u4ef6 frpc.ini \u5e76\u4e14\u914d\u7f6e\u8fd9\u4e2a\u6587\u4ef6\uff0c\u6bd4\u5982\u6211\u5efa\u7acb\u5728 \/volume1\/docker\/frpc\/conf\/frpc.ini \u914d\u7f6e\u6a21\u677f: [common] server_addr = www.yourdomain.com #frps\u670d\u52a1\u7aef\u5730\u5740 server_port = 7000 #frps\u670d\u52a1\u7aef\u901a\u8baf\u7aef\u53e3\uff0c\u5ba2\u6237\u7aef\u8fde\u63a5\u5230\u670d\u52a1\u7aef\u5185\u7f51\u7a7f\u900f\u4f20\u8f93\u6570\u636e\u7684\u7aef\u53e3 pr [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[17],"class_list":["post-30","post","type-post","status-publish","format-standard","hentry","category-16","tag-docker"],"_links":{"self":[{"href":"http:\/\/blog.naspro.cc\/index.php?rest_route=\/wp\/v2\/posts\/30","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/blog.naspro.cc\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.naspro.cc\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.naspro.cc\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.naspro.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=30"}],"version-history":[{"count":0,"href":"http:\/\/blog.naspro.cc\/index.php?rest_route=\/wp\/v2\/posts\/30\/revisions"}],"wp:attachment":[{"href":"http:\/\/blog.naspro.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=30"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.naspro.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=30"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.naspro.cc\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=30"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}