{"id":768,"date":"2026-08-12T06:56:52","date_gmt":"2026-08-11T22:56:52","guid":{"rendered":"http:\/\/www.tantan.ink\/index.php\/2026\/08\/12\/rathole%ef%bc%9a%e7%94%a8-rust-%e5%86%99%e7%9a%84%e8%bd%bb%e9%87%8f%e5%86%85%e7%bd%91%e7%a9%bf%e9%80%8f%ef%bc%8c%e6%8a%8a%e5%ae%b6%e9%87%8c-nas-%e5%ae%89%e5%85%a8%e5%9c%b0%e8%bd%ac%e5%87%ba%e5%8e%bb\/"},"modified":"2026-08-12T06:56:52","modified_gmt":"2026-08-11T22:56:52","slug":"rathole%ef%bc%9a%e7%94%a8-rust-%e5%86%99%e7%9a%84%e8%bd%bb%e9%87%8f%e5%86%85%e7%bd%91%e7%a9%bf%e9%80%8f%ef%bc%8c%e6%8a%8a%e5%ae%b6%e9%87%8c-nas-%e5%ae%89%e5%85%a8%e5%9c%b0%e8%bd%ac%e5%87%ba%e5%8e%bb","status":"publish","type":"post","link":"https:\/\/www.tantan.ink\/index.php\/2026\/08\/12\/rathole%ef%bc%9a%e7%94%a8-rust-%e5%86%99%e7%9a%84%e8%bd%bb%e9%87%8f%e5%86%85%e7%bd%91%e7%a9%bf%e9%80%8f%ef%bc%8c%e6%8a%8a%e5%ae%b6%e9%87%8c-nas-%e5%ae%89%e5%85%a8%e5%9c%b0%e8%bd%ac%e5%87%ba%e5%8e%bb\/","title":{"rendered":"rathole\uff1a\u7528 Rust \u5199\u7684\u8f7b\u91cf\u5185\u7f51\u7a7f\u900f\uff0c\u628a\u5bb6\u91cc NAS \u5b89\u5168\u5730\u8f6c\u51fa\u53bb"},"content":{"rendered":"<h2>\u5bb6\u91cc\u6709\u53f0 NAS\uff0c\u60f3\u628a\u670d\u52a1\u5b89\u5168\u5730\u66b4\u9732\u51fa\u53bb\uff0c\u4f46\u53c8\u4e0d\u60f3\u88ab\u5404\u79cd\u5546\u4e1a\u96a7\u9053\u7ed1\u67b6\uff1frathole \u8fd9\u4e2a\u7528 Rust \u5199\u7684\u5c0f\u5de5\u5177\u503c\u5f97\u4e00\u770b\u3002<\/h2>\n<p>\u6211\u6298\u817e\u5185\u7f51\u7a7f\u900f\u597d\u4e9b\u5e74\u4e86\uff0c\u4ece\u6700\u65e9\u7684 ngrok \u514d\u8d39\u7248\uff0c\u5230\u540e\u6765 frp \u4e00\u628a\u68ad\uff0c\u518d\u5230\u5404\u79cd\u5e26Web\u9762\u677f\u7684\u65b9\u6848\u3002\u8bf4\u5b9e\u8bdd\uff0c\u5927\u90e8\u5206\u65f6\u5019\u6211\u7684\u9700\u6c42\u5f88\u7b80\u5355\uff1a\u628a\u5bb6\u91cc\u90a3\u53f0 NAS \u4e0a\u7684\u67d0\u4e2a\u670d\u52a1\uff08SSH\u3001Web \u7ba1\u7406\u754c\u9762\uff09\u901a\u8fc7\u4e00\u4e2a\u6709\u516c\u7f51 IP \u7684\u8df3\u677f\u673a\u8f6c\u51fa\u53bb\uff0c\u7a33\u5b9a\u3001\u7701\u8d44\u6e90\u3001\u522b\u592a\u590d\u6742\u5c31\u884c\u3002<\/p>\n<p>rathole \u5c31\u662f\u51b2\u7740\u8fd9\u4e2a\u76ee\u6807\u53bb\u7684\u3002\u5b83\u548c frp \u601d\u8def\u51e0\u4e4e\u4e00\u81f4\uff0c\u4f46\u4f5c\u8005\u7528 Rust \u91cd\u5199\u4e86\u4e00\u904d\uff0c\u4e3b\u6253<strong>\u9ad8\u6027\u80fd + \u4f4e\u5185\u5b58\u5360\u7528 + \u7b80\u5355\u914d\u7f6e<\/strong>\u3002\u76ee\u524d\u5728 GitHub \u4e0a 1.4 \u4e07 stars\uff0cApache-2.0 \u534f\u8bae\uff0c\u5355\u4e8c\u8fdb\u5236\u6700\u5c0f\u53ef\u4ee5\u538b\u5230 500KiB \u5de6\u53f3\u2014\u2014\u8fd9\u610f\u5473\u7740\u4f60\u751a\u81f3\u53ef\u4ee5\u628a\u5b83\u585e\u8fdb\u8def\u7531\u5668\u7684\u95ea\u5b58\u91cc\u8dd1\u3002<\/p>\n<h3>\u4e3a\u4ec0\u4e48\u662f rathole \u800c\u4e0d\u662f frp<\/h3>\n<p>\u5148\u8bf4\u6e05\u695a\uff1a\u5982\u679c\u4f60 frp \u7528\u5f97\u597d\u597d\u7684\uff0c\u6ca1\u5fc5\u8981\u4e13\u95e8\u6362\u3002\u4f46 rathole \u6709\u51e0\u4e2a\u70b9\u786e\u5b9e\u66f4\u5bf9\u6211\u80c3\u53e3\uff1a<\/p>\n<p><strong>\u5185\u5b58\u5360\u7528\u660e\u663e\u66f4\u4f4e\u3002<\/strong>\u5b98\u65b9 benchmark \u662f\u5728\u672c\u5730\u56de\u73af\u4e0a\u6d4b\u7684\uff08CPU \u74f6\u9888\u573a\u666f\uff09\uff0crathole \u541e\u5410\u6bd4 frp \u9ad8\u3001\u5185\u5b58\u66f4\u7701\u3002\u4f5c\u8005\u81ea\u5df1\u4e5f\u8bda\u5b9e\u63d0\u9192\uff1a<strong>\u522b\u6307\u671b\u5b83\u80fd\u8ba9\u4f60\u7684\u8f6c\u53d1\u51ed\u7a7a\u5feb\u597d\u51e0\u500d<\/strong>\u2014\u2014\u5982\u679c\u74f6\u9888\u5728\u7f51\u7edc\u800c\u4e0d\u662f CPU\uff0c\u4f60\u611f\u77e5\u5230\u7684\u63d0\u5347\u4e3b\u8981\u662f&#8221;\u66f4\u7701\u8d44\u6e90&#8221;\uff0c\u5e26\u5bbd\u548c\u5ef6\u8fdf\u672a\u5fc5\u6709\u8d28\u53d8\u3002\u8fd9\u70b9\u6211\u5f88\u6b23\u8d4f\uff0c\u4e0d\u5439\u725b\u3002<\/p>\n<p><strong>\u914d\u7f6e\u6309\u670d\u52a1\u62c6\u5206\u5230\u4e24\u7aef\u3002<\/strong>\u8fd9\u662f rathole \u548c frp \u6700\u5927\u7684\u4f7f\u7528\u5dee\u5f02\uff1afrp \u7684\u670d\u52a1\u8f6c\u53d1\u914d\u7f6e\u5199\u5728\u4e00\u8fb9\uff0crathole \u628a\u6bcf\u4e2a\u670d\u52a1\u7684\u914d\u7f6e<strong>\u62c6\u6210\u4e86\u670d\u52a1\u7aef\u548c\u5ba2\u6237\u7aef\u5404\u4e00\u4efd<\/strong>\uff0c\u800c\u4e14\u6bcf\u4e2a\u670d\u52a1\u5f3a\u5236\u5355\u72ec token\u3002\u4e4d\u770b\u9ebb\u70e6\uff0c\u5b9e\u9645\u66f4\u5b89\u5168\u2014\u2014\u670d\u52a1\u7aef\u548c\u5ba2\u6237\u7aef\u5404\u7ba1\u5404\u7684\u5bc6\u94a5\uff0c\u6cc4\u9732\u4e00\u4e2a\u4e0d\u5f71\u54cd\u5168\u5c40\u3002<\/p>\n<p><strong>\u4f20\u8f93\u52a0\u5bc6\u5f00\u7bb1\u5373\u7528\u3002<\/strong>\u652f\u6301 Noise Protocol\uff08\u4e0d\u9700\u8981\u81ea\u7b7e\u8bc1\u4e66\uff0c\u914d\u4e2a key \u5c31\u884c\uff09\u548c TLS \u4e24\u79cd\u3002\u5bf9\u4e8e\u4e0d\u60f3\u6298\u817e\u8bc1\u4e66\u7684\u4eba\u6765\u8bf4\uff0cNoise \u6a21\u5f0f\u771f\u7684\u89e3\u653e\u751f\u4ea7\u529b\u3002<\/p>\n<h3>\u600e\u4e48\u7528\uff1a\u4e00\u4e2a\u6700\u5c0f\u53ef\u8dd1\u7684\u4f8b\u5b50<\/h3>\n<p>\u5047\u8bbe\u4f60\u6709\u4e00\u53f0\u6709\u516c\u7f51 IP \u7684\u8df3\u677f\u673a\uff0c\u5bb6\u91cc NAT \u540e\u9762\u6709\u53f0 NAS\uff0c\u60f3\u628a\u5b83 22 \u7aef\u53e3\u7684 SSH \u66b4\u9732\u51fa\u53bb\u3002<\/p>\n<p><strong>\u8df3\u677f\u673a\uff08server.toml\uff09\uff1a<\/strong><\/p>\n<pre><code>[server]\nbind_addr = \"0.0.0.0:2333\"\n\n[server.services.my_nas_ssh]\ntoken = \"\u6362\u6210\u4f60\u81ea\u5df1\u7684\u5f3a\u968f\u673a\u4e32\"\nbind_addr = \"0.0.0.0:5202\"\n<\/code><\/pre>\n<p><strong>NAS\uff08client.toml\uff09\uff1a<\/strong><\/p>\n<pre><code>[client]\nremote_addr = \"\u4f60\u7684\u8df3\u677f\u673a\u5730\u5740:2333\"\n\n[client.services.my_nas_ssh]\ntoken = \"\u548c\u4e0a\u9762\u4e00\u81f4\"\nlocal_addr = \"127.0.0.1:22\"\n<\/code><\/pre>\n<p>\u4e24\u8fb9\u5404\u8dd1 <code>.\/rathole xxx.toml<\/code>\uff0c\u7136\u540e\u4ece\u5916\u9762 <code>ssh \u8df3\u677f\u673a:5202<\/code> \u5c31\u80fd\u8fde\u56de\u5bb6\u91cc NAS \u4e86\u3002Linux \u4e0a\u5efa\u8bae\u914d\u4e2a systemd \u8ba9\u5b83\u80fd\u5f00\u673a\u81ea\u542f\u3001\u5d29\u6e83\u62c9\u8d77\uff0c\u9879\u76ee examples \u76ee\u5f55\u91cc\u6709\u73b0\u6210\u6a21\u677f\u3002<\/p>\n<p><strong>\u60f3\u52a0\u5bc6\u4f20\u8f93\uff1f<\/strong>\u5728\u4e24\u7aef transport \u5757\u52a0\u4e0a\uff1a<\/p>\n<pre><code>[client.transport]\ntype = \"noise\"\n<\/code><\/pre>\n<p>\u670d\u52a1\u7aef\u540c\u7406\u3002\u4e0d\u9700\u8981 CA\u3001\u4e0d\u9700\u8981\u8bc1\u4e66\uff0cNoise \u81ea\u5df1\u641e\u5b9a\u63e1\u624b\u52a0\u5bc6\u3002<\/p>\n<h3>\u51e0\u4e2a\u5b9e\u9645\u8981\u6ce8\u610f\u7684\u5751<\/h3>\n<p><strong>1. token \u662f\u660e\u6587\u5199\u5728\u914d\u7f6e\u6587\u4ef6\u91cc\u7684\u3002<\/strong>rathole \u672c\u8eab\u4e0d\u505a\u5bc6\u94a5\u7ba1\u7406\uff0c\u914d\u7f6e\u6587\u4ef6\u6743\u9650\u8981\u81ea\u5df1\u7ba1\u597d\uff08chmod 600 \u8d77\u6b65\uff09\uff0c\u522b\u628a\u542b token \u7684\u914d\u7f6e\u63d0\u4ea4\u5230\u516c\u5f00\u4ed3\u5e93\u3002<\/p>\n<p><strong>2. \u70ed\u91cd\u8f7d\u662f\u4eae\u70b9\u4e5f\u662f\u98ce\u9669\u70b9\u3002<\/strong>rathole \u652f\u6301\u6539\u4e86\u914d\u7f6e\u4e0d\u7528\u91cd\u542f\u5c31\u80fd\u52a8\u6001\u52a0\u5220\u670d\u52a1\uff0c\u65b9\u4fbf\u662f\u771f\u65b9\u4fbf\uff0c\u4f46\u751f\u4ea7\u73af\u5883\u6539\u914d\u7f6e\u524d\u6700\u597d\u5148\u5728\u6d4b\u8bd5\u670d\u52a1\u4e0a\u9a8c\u8bc1\uff0c\u522b\u624b\u6ed1\u628a\u6b63\u5728\u8dd1\u7684\u8f6c\u53d1\u5e72\u6389\u3002<\/p>\n<p><strong>3. HTTP API \u8fd8\u662f WIP\u3002<\/strong>\u5982\u679c\u4f60\u60f3\u7528\u811a\u672c\u81ea\u52a8\u5316\u7ba1\u7406\u8f6c\u53d1\u89c4\u5219\uff0c\u76ee\u524d\u5f97\u9760\u6539\u914d\u7f6e\u6587\u4ef6 + \u70ed\u91cd\u8f7d\uff0c\u6ca1\u6709\u73b0\u6210\u7684 REST API\u3002\u5bf9\u7eaf\u624b\u52a8\u7ba1\u7406\u5b8c\u5168\u591f\u7528\uff0c\u5927\u89c4\u6a21\u7f16\u6392\u5c31\u7b97\u4e86\u3002<\/p>\n<p><strong>4. \u6700\u65b0 release \u662f v0.5.0\uff082023 \u5e74\uff09\uff0c\u4f46\u4e3b\u5206\u652f\u4e00\u76f4\u5728\u52a8\u3002<\/strong>\u8fd9\u4e2a\u7248\u672c\u53f7\u770b\u7740\u5413\u4eba\uff0c\u5176\u5b9e\u4f5c\u8005\u7ef4\u62a4\u8fd8\u7b97\u7a33\uff0cissue \u6709\u5728\u56de\u3002\u4ecb\u610f\u7684\u8bdd\u53ef\u4ee5\u81ea\u5df1\u4ece\u6e90\u7801 build\uff0cRust \u5de5\u5177\u94fe\u4e00\u6761\u547d\u4ee4\u7684\u4e8b\u3002<\/p>\n<p><strong>5. \u5b89\u5168\u9760 token  alone\u3002<\/strong>\u6bcf\u4e2a\u670d\u52a1\u5355\u72ec token \u662f\u597d\u4e8b\uff0c\u4f46\u8df3\u677f\u673a\u672c\u8eab\u7684\u9632\u706b\u5899\u89c4\u5219\u3001\u53ea\u66b4\u9732\u5fc5\u8981\u7aef\u53e3\u8fd9\u4e9b\u57fa\u672c\u529f\u8fd8\u662f\u5f97\u505a\u3002rathole \u4e0d\u66ff\u4f60\u7ba1\u7f51\u7edc\u5c42\u5b89\u5168\u3002<\/p>\n<h3>\u8c01\u9002\u5408\u7528<\/h3>\n<p>\u5982\u679c\u4f60\u548c\u6211\u4e00\u6837\uff0c<strong>\u60f3\u8981\u4e00\u4e2a\u8f7b\u91cf\u3001\u7701\u5185\u5b58\u3001\u914d\u7f6e\u4e0d\u53cd\u4eba\u7c7b\u7684\u8f6c\u53d1\u5de5\u5177<\/strong>\uff0c\u800c\u4e14\u5df2\u7ecf\u6709\u4e00\u53f0\u516c\u7f51\u8df3\u677f\u673a\uff0crathole \u51e0\u4e4e\u662f\u65e0\u8111\u9009\u3002\u5b83\u4e0d\u50cf\u90a3\u4e9b\u5e26\u534e\u4e3d Web \u9762\u677f\u7684\u65b9\u6848\u90a3\u6837\u529f\u80fd\u82b1\u54e8\uff0c\u4f46\u6070\u6070\u56e0\u4e3a\u7b80\u5355\uff0c\u51fa\u95ee\u9898\u7684\u6982\u7387\u4e5f\u4f4e\u3002<\/p>\n<p>\u53cd\u8fc7\u6765\uff0c\u5982\u679c\u4f60\u8981\u7684\u662f&#8221;\u4e00\u952e\u628a\u672c\u5730\u5f00\u53d1\u670d\u52a1\u5668\u5206\u4eab\u7ed9\u540c\u4e8b\u770b\u4e00\u773c&#8221;\u8fd9\u79cd\u6781\u8f7b\u91cf\u573a\u666f\uff0crathole \u8fd8\u662f\u5f97\u4f60\u5148\u6709\u8df3\u677f\u673a\uff0c\u4e0d\u5982\u7528 cloudflared \u6216\u8005 serveo \u4e4b\u7c7b\u7684\u96f6\u90e8\u7f72\u65b9\u6848\u3002\u5de5\u5177\u6ca1\u6709\u94f6\u5f39\uff0c\u770b\u573a\u666f\u3002<\/p>\n<p>\u6211\u7528\u5b83\u628a\u5bb6\u91cc\u51e0\u4e2a\u5c0f\u670d\u52a1\u8f6c\u51fa\u6765\u8dd1\u4e86\u5c0f\u534a\u5e74\uff0c\u6700\u76f4\u89c2\u7684\u611f\u53d7\u5c31\u662f\uff1a<strong>\u8df3\u677f\u673a\u5185\u5b58\u5360\u7528\u8089\u773c\u53ef\u89c1\u5730\u964d\u4e86<\/strong>\uff0c\u914d\u7f6e\u6539\u8d77\u6765\u4e5f\u6bd4\u4e4b\u524d\u90a3\u5957\u987a\u624b\u3002\u5bf9\u4e8e\u81ea\u6258\u7ba1\u73a9\u5bb6\u6765\u8bf4\uff0c\u8fd9\u73a9\u610f\u513f\u53ef\u4ee5\u8fdb\u5e38\u5907\u5de5\u5177\u7bb1\u4e86\u3002<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.tantan.ink\/wp-content\/uploads\/2026\/08\/rathole-logo-s.png\" alt=\"rathole logo\" \/><br \/>\n<img decoding=\"async\" src=\"http:\/\/www.tantan.ink\/wp-content\/uploads\/2026\/08\/mem-graph-rgb.png\" alt=\"rathole mem\" \/><br \/>\n<img decoding=\"async\" src=\"http:\/\/www.tantan.ink\/wp-content\/uploads\/2026\/08\/http_throughput-s.png\" alt=\"rathole http\" \/><br \/>\n<img decoding=\"async\" src=\"http:\/\/www.tantan.ink\/wp-content\/uploads\/2026\/08\/tcp_bitrate-s.png\" alt=\"rathole tcp\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5bb6\u91cc\u6709\u53f0 NAS\uff0c\u60f3\u628a\u670d\u52a1\u5b89\u5168\u5730\u66b4\u9732\u51fa\u53bb\uff0c\u4f46\u53c8\u4e0d\u60f3\u88ab\u5404\u79cd\u5546\u4e1a\u96a7\u9053\u7ed1\u67b6\uff1frathole \u8fd9\u4e2a\u7528 Rust \u5199\u7684\u5c0f &#8230; <a title=\"rathole\uff1a\u7528 Rust \u5199\u7684\u8f7b\u91cf\u5185\u7f51\u7a7f\u900f\uff0c\u628a\u5bb6\u91cc NAS \u5b89\u5168\u5730\u8f6c\u51fa\u53bb\" class=\"read-more\" href=\"https:\/\/www.tantan.ink\/index.php\/2026\/08\/12\/rathole%ef%bc%9a%e7%94%a8-rust-%e5%86%99%e7%9a%84%e8%bd%bb%e9%87%8f%e5%86%85%e7%bd%91%e7%a9%bf%e9%80%8f%ef%bc%8c%e6%8a%8a%e5%ae%b6%e9%87%8c-nas-%e5%ae%89%e5%85%a8%e5%9c%b0%e8%bd%ac%e5%87%ba%e5%8e%bb\/\" aria-label=\"\u9605\u8bfb rathole\uff1a\u7528 Rust \u5199\u7684\u8f7b\u91cf\u5185\u7f51\u7a7f\u900f\uff0c\u628a\u5bb6\u91cc NAS \u5b89\u5168\u5730\u8f6c\u51fa\u53bb\">\u9605\u8bfb\u66f4\u591a<\/a><\/p>\n","protected":false},"author":2,"featured_media":764,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,10],"tags":[],"class_list":["post-768","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ai","category-software"],"_links":{"self":[{"href":"https:\/\/www.tantan.ink\/index.php\/wp-json\/wp\/v2\/posts\/768","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.tantan.ink\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tantan.ink\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tantan.ink\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tantan.ink\/index.php\/wp-json\/wp\/v2\/comments?post=768"}],"version-history":[{"count":0,"href":"https:\/\/www.tantan.ink\/index.php\/wp-json\/wp\/v2\/posts\/768\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.tantan.ink\/index.php\/wp-json\/wp\/v2\/media\/764"}],"wp:attachment":[{"href":"https:\/\/www.tantan.ink\/index.php\/wp-json\/wp\/v2\/media?parent=768"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tantan.ink\/index.php\/wp-json\/wp\/v2\/categories?post=768"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tantan.ink\/index.php\/wp-json\/wp\/v2\/tags?post=768"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}