{"id":10020791,"date":"2025-05-08T20:26:20","date_gmt":"2025-05-08T12:26:20","guid":{"rendered":"https:\/\/itmax.cn\/?p=10020791"},"modified":"2025-05-08T20:26:20","modified_gmt":"2025-05-08T12:26:20","slug":"funproxy-%e4%bd%bf%e7%94%a8-rust-%e6%9e%84%e5%bb%ba%e8%b7%a8%e5%b9%b3%e5%8f%b0%e5%85%a8%e9%93%be%e8%b7%af%e6%b5%8b%e8%af%95%e6%8a%93%e5%8c%85%e4%bb%a3%e7%90%86%e5%b7%a5%e5%85%b7","status":"publish","type":"post","link":"https:\/\/itmax.cn\/?p=10020791","title":{"rendered":"FunProxy &#8211; \u4f7f\u7528 Rust \u6784\u5efa\u8de8\u5e73\u53f0\u5168\u94fe\u8def\u6d4b\u8bd5\u6293\u5305\u4ee3\u7406\u5de5\u5177"},"content":{"rendered":"<blockquote>\n<p>\u4f5c\u8005\uff1avivo \u4e92\u8054\u7f51\u5927\u524d\u7aef\u56e2\u961f- Song Jiachao<\/p>\n<p>\u5728\u8f6f\u4ef6\u5f00\u53d1\u8fc7\u7a0b\u4e2d\uff0c\u8f6f\u4ef6\u6d4b\u8bd5\u5bf9\u4e8e\u4fdd\u969c\u8f6f\u4ef6\u8d28\u91cf\u548c\u7528\u6237\u6ee1\u610f\u5ea6\u8d77\u7740\u5173\u952e\u4f5c\u7528\u3002\u4e3a\u6700\u5927\u7a0b\u5ea6\u4e0a\u63d0\u5347\u8f6f\u4ef6\u54c1\u8d28\uff0c\u6211\u4eec\u79ef\u6781\u5f00\u5c55\u5168\u94fe\u8def\u6d4b\u8bd5\u5b9e\u8df5\uff0c\u6253\u9020\u4e86\u7528Rust\u8bed\u8a00\u5f00\u53d1\u7684\u81ea\u7814\u4e00\u7ad9\u5f0f\u6293\u5305\u4ee3\u7406\u5de5\u5177FunProxy\uff0c\u57fa\u4e8e\u5176\u8de8\u5e73\u53f0\u3001\u9ad8\u6027\u80fd\u3001\u6613\u4e8e\u6269\u5c55\u3001\u5b89\u5168\u6027\u9ad8\u7b49\u7279\u6027\uff0c\u8ba9\u5168\u94fe\u8def\u6293\u5305\u548c\u73af\u5883\u4ee3\u7406\u5982\u4e1d\u7ef8\u822c\u4e1d\u6ed1\u3002<\/p>\n<\/blockquote>\n<h2>\u4e00\u3001\u80cc\u666f\u4ecb\u7ecd<\/h2>\n<h3>1.1 \u4ec0\u4e48\u662f\u5168\u94fe\u8def\u6d4b\u8bd5<\/h3>\n<p>\u5168\u94fe\u8def\u6d4b\u8bd5\u5c31\u662f&#8221;\u9a8c\u8bc1\u6574\u4e2a\u8f6f\u4ef6\u7cfb\u7edf\u5728\u4e0d\u540c\u7ec4\u4ef6\u3001\u670d\u52a1\u548c\u6a21\u5757\u4e4b\u95f4\u534f\u540c\u5de5\u4f5c\u65f6\u7684\u6027\u80fd\u3001\u529f\u80fd\u548c\u7a33\u5b9a\u6027&#8221;\u3002\u5728\u8fd9\u91cc\u6211\u4eec\u4e3e\u4e00\u4e2a\u975e\u5e38\u7b80\u5355\u7684\u4f8b\u5b50\u3002<\/p>\n<p>\u6bd4\u5982\u7528\u6237\u5728\u67d0\u5546\u57ce\u8d2d\u4e70\u5546\u54c1\u3002<\/p>\n<p><img decoding=\"async\"   referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000046524318\" alt=\"\u56fe\u7247\" title=\"\u56fe\u7247\"><\/p>\n<p>\u6211\u4eec\u662f\u5148\u6253\u5f00\u5546\u57ce\uff0c\u63a5\u7740\u6d4f\u89c8\u5546\u54c1\uff0c\u52a0\u5165\u8d2d\u7269\u8f66\uff0c\u7136\u540e\u63d0\u4ea4\u8ba2\u5355\uff0c\u652f\u4ed8\uff0c\u7b49\u5f85\u6536\u8d27\uff0c\u6700\u540e\u5b8c\u6210\u3002\u5728\u6574\u4e2a\u8d2d\u4e70\u6d41\u7a0b\u4e2d\uff0c\u6211\u4eec\u5176\u5b9e\u5e76\u4e0d\u662f\u4e00\u4e2a\u529f\u80fd\u6a21\u5757\u5c31\u5b8c\u6210\u5168\u90e8\u6b65\u9aa4\uff0c\u800c\u662f\u8c03\u7528\u4e86\u5f88\u591a\u7cfb\u7edf\u6a21\u5757\u3002<\/p>\n<p>\u6bd4\u5982\uff1a<\/p>\n<p>\u5168\u94fe\u8def\u6d4b\u8bd5\u5c31\u662f\u9a8c\u8bc1\u4e00\u4e2a\u6d41\u7a0b\u4e2d\u6240\u6709\u6d89\u53ca\u7684\u7cfb\u7edf\uff0c\u534f\u540c\u5de5\u4f5c\u65f6\u7684\u6027\u80fd\u3001\u529f\u80fd\u548c\u7a33\u5b9a\u6027\u3002<\/p>\n<h3>1.2 \u5168\u94fe\u8def\u6d4b\u8bd5\u7684\u73b0\u72b6\u548c\u75db\u70b9<\/h3>\n<p>\u901a\u8fc7\u4e0a\u9762\u7684\u8d2d\u7269\u6d41\u7a0b\u6211\u4eec\u53ef\u4ee5\u68b3\u7406\u51fa\u5168\u94fe\u8def\u6d4b\u8bd5\u7684\u73b0\u72b6\u548c\u75db\u70b9\uff1a<\/p>\n<p><strong>1. \u7cfb\u7edf\u6570\u91cf\u4f17\u591a<\/strong><\/p>\n<p>\u5168\u94fe\u8def\u6d4b\u8bd5\u6d89\u53ca\u5230\u591a\u4e2a\u7cfb\u7edf\u3001\u670d\u52a1\u548c\u6a21\u5757\u7684\u534f\u540c\u5de5\u4f5c\uff0c\u7cfb\u7edf\u7684\u591a\u6837\u6027\u589e\u52a0\u4e86\u6d4b\u8bd5\u7684\u590d\u6742\u6027\u3002<\/p>\n<p><strong>2. \u5404\u7cfb\u7edf\u73af\u5883\u914d\u7f6e\u4e0d\u4e00\u81f4<\/strong><\/p>\n<p>\u5404\u4e2a\u7cfb\u7edf\u7684\u73af\u5883\u914d\u7f6e\u53ef\u80fd\u5b8c\u5168\u4e0d\u4e00\u6837\uff0c\u5bfc\u81f4\u5404\u4e2a\u7cfb\u7edf\u5bf9\u63a5\u76f8\u5f53\u9ebb\u70e6\u3002<\/p>\n<p><img decoding=\"async\"   referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000046524319\" alt=\"\u56fe\u7247\" title=\"\u56fe\u7247\" loading=\"lazy\"><\/p>\n<p>\u5c31\u62ff\u6211\u4eec\u521a\u521a\u6240\u4e3e\u51fa\u7528\u6237\u8d2d\u4e70\u5546\u54c1\u7684\u4f8b\u5b50\u3002\u6d89\u53ca\u5230\u5546\u54c1\u7cfb\u7edf\u3001\u8d2d\u7269\u8f66\u7cfb\u7edf\u3001\u8ba2\u5355\u7cfb\u7edf\u3001\u652f\u4ed8\u7cfb\u7edf\u3001\u548c\u7269\u6d41\u7cfb\u7edf\u3002\u56e0\u4e3a\u5386\u53f2\u6216\u8005\u6280\u672f\u65b9\u6848\u7684\u539f\u56e0\uff0c\u4ed6\u4eec\u9009\u62e9\u7684\u73af\u5883\u7ba1\u7406\u65b9\u5f0f\u5404\u4e0d\u76f8\u540c\u3002<\/p>\n<ul>\n<li>\u5176\u4e2d\u5546\u54c1\u548c\u8d2d\u7269\u8f66\u7cfb\u7edf\u53ef\u80fd\u662f\u7531\u56e2\u961f A \u8d1f\u8d23\uff0c\u4ed6\u4eec\u56e2\u961f\u901a\u8fc7 hosts \u65b9\u5f0f\u6765\u7ba1\u7406\u73af\u5883\u3002<\/li>\n<li>\u8ba2\u5355\u548c\u652f\u4ed8\u7cfb\u7edf\uff0c\u7531\u56e2\u961fB\u8d1f\u8d23\uff0c\u901a\u8fc7\u81ea\u5b9a\u4e49\u8bf7\u6c42\u5934\u7684\u65b9\u5f0f\uff0c\u6765\u8fdb\u884c\u73af\u5883\u914d\u7f6e\u3002<\/li>\n<li>\u7269\u6d41\u7cfb\u7edf\u7531\u56e2\u961f C \u8d1f\u8d23\uff0c\u901a\u8fc7\u57df\u540d\u7684\u65b9\u5f0f\u6765\u914d\u7f6e\u73af\u5883\u3002<\/li>\n<\/ul>\n<p>\u8fd9\u53ea\u662f\u7cbe\u7b80\u7248\u7684\u8d2d\u7269\u6d41\u7a0b\uff0c\u5176\u771f\u5b9e\u60c5\u51b5\u53ef\u80fd\u8fdc\u6bd4\u6211\u4eec\u7684\u4f8b\u5b50\u66f4\u52a0\u590d\u6742\u3002\u8fd9\u65f6\u5019\u5982\u679c\u60f3\u8981\u5b8c\u6574\u7684\u6d4b\u8bd5\u4e00\u6761\u8d2d\u7269\u5168\u6d41\u7a0b\uff0c\u73af\u5883\u914d\u7f6e\u8fd8\u662f\u76f8\u5f53\u590d\u6742\u7684\u3002<\/p>\n<p><strong>\u5f53\u524d\u6d4b\u8bd5\u6d41\u7a0b<\/strong><\/p>\n<p>\u4e3a\u4e86\u80fd\u591f\u6d4b\u8bd5\u6240\u6709\u7684\u6d41\u7a0b\uff1a<\/p>\n<ul>\n<li>\u8981\u5b89\u88c5\u4e00\u4e2a\u6293\u5305\u8f6f\u4ef6<\/li>\n<li>\u5b89\u88c5\u6293\u5305\u8f6f\u4ef6\u7684\u8bc1\u4e66<\/li>\n<li>\u914d\u7f6e\u5404\u79cd\u6293\u5305\u7684\u89c4\u5219<\/li>\n<li>\u914d\u7f6e\u6293\u5305\u7684\u7cfb\u7edf\u4ee3\u7406<\/li>\n<li>\u914d\u7f6ehosts<\/li>\n<li>\u914d\u7f6e\u7ec8\u7aef\uff08\u5b89\u88c5\u8bc1\u4e66\u3001\u8bbe\u7f6e\u624b\u673a\u4ee3\u7406\uff09<\/li>\n<\/ul>\n<p>\u8fd9\u4e00\u5957\u6d41\u7a0b\u4e0b\u6765\u5176\u5b9e\u9700\u8981\u914d\u7f6e\u7684\u975e\u5e38\u590d\u6742\uff0c\u5e76\u4e14\u4e0d\u80fd\u5171\u4eab\uff0c\u6bcf\u4e2a\u4eba\u5728\u81ea\u5df1\u7684\u7535\u8111\u548c\u624b\u673a\u4e0a\u90fd\u9700\u8981\u91cd\u65b0\u914d\u7f6e\u4e00\u904d\u3002<\/p>\n<p><img decoding=\"async\"   referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000046524320\" alt=\"\u56fe\u7247\" title=\"\u56fe\u7247\" loading=\"lazy\"><\/p>\n<h2>\u4e8c\u3001\u5168\u94fe\u8def\u6d4b\u8bd5\u7684\u613f\u666f\u53ca\u76ee\u6807<\/h2>\n<p>\u56e0\u4e3a\u4e0a\u8ff0\u80cc\u666f\uff0c\u6211\u4eec\u5bf9vivo\u7684\u5168\u94fe\u8def\u6d4b\u8bd5\u63d0\u51fa\u4ee5\u4e0b\u7684\u613f\u666f\u548c\u76ee\u6807\u3002<\/p>\n<p>\u6211\u4eec\u7684<strong>\u613f\u666f<\/strong>\u662f\uff1a\u8ba9 vivo \u7684\u5168\u94fe\u8def\u6293\u5305\u548c\u73af\u5883\u4ee3\u7406\uff0c\u5982\u4e1d\u7ef8\u822c\u4e1d\u6ed1\u3002<\/p>\n<p>\u6211\u4eec\u7684<strong>\u76ee\u6807<\/strong>\u662f\uff1a\u6784\u5efa\u4e00\u6b3e\u8de8\u5e73\u53f0\u3001\u9ad8\u6027\u80fd\u3001\u6613\u4e8e\u6269\u5c55\u3001\u5b89\u5168\u6027\u9ad8\u7684\u5168\u94fe\u8def\u6d4b\u8bd5\u6293\u5305\u4ee3\u7406\u5de5\u5177\u3002<\/p>\n<p><img decoding=\"async\"   referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000046524321\" alt=\"\u56fe\u7247\" title=\"\u56fe\u7247\" loading=\"lazy\"><\/p>\n<h3>2.1 \u6280\u672f\u76ee\u6807\u8be6\u89e3<\/h3>\n<p><strong>\u8de8\u5e73\u53f0<\/strong><\/p>\n<p>\u80fd\u591f\u652f\u6301\u51e0\u4e4e\u6240\u6709\u4e3b\u6d41\u5e73\u53f0\uff0c\u5305\u62ec\u4f46\u4e0d\u9650\u4e8eWindows\/macOS\/Linux\/Android\/iOS\uff0c\u4e3a\u4ec0\u4e48\u8981\u517c\u5bb9\u8fd9\u4e48\u591a\u5e73\u53f0\uff0c\u56e0\u4e3a\u6211\u4eec\u7684\u4e1a\u52a1\u5728\u8fd9\u4e9b\u5e73\u53f0\u4e0a\u9762\u51e0\u4e4e\u90fd\u6709\u6d89\u53ca\u3002<\/p>\n<p><strong>\u9ad8\u6027\u80fd<\/strong><\/p>\n<p>\u9762\u5bf9\u8d85\u9ad8\u5e76\u53d1\u91cf\u7684\u63a5\u53e3\u8bf7\u6c42\uff0c\u80fd\u591f\u8f7b\u677e\u5e94\u5bf9\uff0c\u786e\u4fdd\u7cfb\u7edf\u5728\u9ad8\u8d1f\u8f7d\u4e0b\u7684\u7a33\u5b9a\u8fd0\u884c\u3002<\/p>\n<p><strong>\u6613\u62d3\u5c55<\/strong><\/p>\n<p>\u63d0\u4f9b\u7075\u6d3b\u7684\u67b6\u6784\u548c\u5de5\u5177\uff0c\u652f\u6301\u5b98\u65b9\u548c\u7528\u6237\u6839\u636e\u4e2a\u4eba\u9700\u8981\u5bf9\u5de5\u5177\u8fdb\u884c\u62d3\u5c55\u3002<\/p>\n<p><strong>\u5b89\u5168\u6027\u9ad8<\/strong><\/p>\n<p>\u901a\u8fc7\u5168\u9762\u7684\u5b89\u5168\u6d4b\u8bd5\uff0c\u786e\u4fdd\u4ea7\u54c1\u5728\u5404\u4e2a\u5c42\u7ea7\u7684\u5b89\u5168\u6027\uff0c\u5305\u62ec\u6570\u636e\u4f20\u8f93\u3001\u5b58\u50a8\u548c\u8bbf\u95ee\u63a7\u5236\uff0c\u9632\u6b62\u6f5c\u5728\u7684\u5b89\u5168\u5a01\u80c1\u548c\u6570\u636e\u6cc4\u9732\u3002<\/p>\n<p><img decoding=\"async\"   referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000046524322\" alt=\"\u56fe\u7247\" title=\"\u56fe\u7247\" loading=\"lazy\"><\/p>\n<h2>\u4e09\u3001\u6280\u672f\u9009\u578b<\/h2>\n<h3>3.1 \u4e3a\u4f55\u9009\u62e9 Rust<\/h3>\n<p>\u6211\u4eec\u9996\u9009\u4e86 Rust \u8bed\u8a00\u4f5c\u4e3a\u6211\u4eec\u7684\u57fa\u7840\u8bed\u8a00\uff0c\u4e3b\u8981\u539f\u56e0\u5982\u4e0b\uff1a<\/p>\n<ul>\n<li>Rust \u662f\u7cfb\u7edf\u7ea7\u522b\u7684\u901a\u7528\u7f16\u7a0b\u8bed\u8a00\uff0c\u4e0a\u81f3web \u4e0b\u81f3OS \u7edf\u7edf\u80fd\u8f7b\u677e\u9a7e\u9a6d\uff0c\u5e76\u4e14\u80fd\u591f\u4fdd\u8bc1\u5185\u5b58\u5b89\u5168\u548c\u5e76\u53d1\u5b89\u5168\uff1b<\/li>\n<li>Rust\u6709\u4e30\u5bcc\u7684\u5de5\u5177\u94fe\uff0c\u6bd4\u5982rustup\uff0ccargo\u7b49\u7b49\uff0c\u5f00\u53d1\u4f53\u9a8c\u975e\u5e38\u68d2\uff1b<\/li>\n<li>Rust\u6709\u975e\u5e38\u5e9e\u5927\u548c\u6d3b\u8dc3\u7684\u793e\u533a\uff0c\u793e\u533a\u8d21\u732e\u4e86\u975e\u5e38\u591a\u597d\u7528\u7684\u5404\u79cd\u5e93\u3002<\/li>\n<\/ul>\n<p>\u5e76\u4e14\u6700\u8fd1\u4f7f\u7528 Rust \u6784\u5efa\u5e94\u7528\u7684\u516c\u53f8\u8d8a\u6765\u8d8a\u591a\uff0c\u6bd4\u5982\u6211\u4eec\u516c\u53f8\u7684 Blue OS \uff0c\u5c31\u662f\u884c\u4e1a\u9996\u4e2a\u7cfb\u7edf\u6846\u67b6\u7531 Rust \u8bed\u8a00\u7f16\u5199\u7684\u64cd\u4f5c\u7cfb\u7edf\uff0c\u8fd9\u4e5f\u662f\u6211\u4eec\u575a\u5b9a\u4e0d\u79fb\u7684\u9009\u62e9Rust\u7684\u91cd\u8981\u539f\u56e0\u4e4b\u4e00\u3002<\/p>\n<p><img decoding=\"async\"   referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000046524323\" alt=\"\u56fe\u7247\" title=\"\u56fe\u7247\" loading=\"lazy\"><\/p>\n<h3>3.2 \u4e3a\u4f55\u9009\u62e9 Tauri<\/h3>\n<p>\u9009\u62e9\u4e86 Rust \uff0c\u6211\u4eec\u987a\u5176\u81ea\u7136\u7684\u9009\u62e9\u4e86 Rust \u591a\u7aef\u5f00\u53d1\u6846\u67b6 Tauri\u3002Tauri \u662f\u4e00\u4e2a\u57fa\u4e8e Rust \u6784\u5efa\u7684\u8de8\u5e73\u53f0\u5e94\u7528\u6846\u67b6\u3002<\/p>\n<p>\u4e3b\u8981\u6709\u4ee5\u4e0b\u51e0\u4e2a\u4f18\u52bf\uff1a<\/p>\n<ol>\n<li><strong>\u72ec\u7acb\u7684\u524d\u7aef\u5de5\u7a0b<\/strong>\uff1aTauri \u652f\u6301\u4efb\u4f55\u524d\u7aef\u6846\u67b6\uff0c\u6240\u4ee5\u4f60\u4e0d\u9700\u8981\u6539\u53d8\u4f60\u7684\u6280\u672f\u6808\uff1b<\/li>\n<li>**\u6700\u5c0f\u5316\u4f53\u79ef\uff1a**\u4f7f\u7528\u64cd\u4f5c\u7cfb\u7edf\u672c\u5730\u7684\u7f51\u9875\u6e32\u67d3\u5668\uff0cTauri \u5e94\u7528\u7684\u4f53\u79ef\u53ef\u4ee5\u8fbe\u5230\u6700\u5c0f 600KB\uff1b<\/li>\n<li>**\u8de8\u5e73\u53f0\uff1a**\u540c\u4e00\u5957\u4ee3\u7801\u53ef\u4ee5\u7f16\u8bd1\u8fd0\u884c\u5230\u51e0\u4e4e\u6240\u6709\u7684OS\u7cfb\u7edf\u4e2d\uff1b<\/li>\n<li>**\u9ad8\u5b89\u5168\u6027\uff1a**Tauri \u56e2\u961f\u7684\u9996\u8981\u76ee\u6807\uff0c\u63a8\u52a8 Tauri \u7684\u9996\u8981\u4efb\u52a1\u548c\u6700\u5927\u7684\u521b\u65b0\u3002<\/li>\n<li>**\u8fdb\u7a0b\u95f4\u901a\u8baf\uff1a**\u7528 JavaScript \u7f16\u5199\u524d\u7aef\uff0c\u7528 Rust \u7f16\u5199\u5e94\u7528\u7a0b\u5e8f\u903b\u8f91\uff0c\u5e76\u4f7f\u7528 Swift \u548c Kotlin \u5728\u7cfb\u7edf\u4e2d\u6df1\u5165\u96c6\u6210\uff1b<\/li>\n<li>**\u7531 Rust \u9a71\u52a8\uff1a**\u4ee5\u6027\u80fd\u548c\u5b89\u5168\u6027\u4e3a\u4e2d\u5fc3\uff0cRust \u662f\u4e0b\u4e00\u4ee3\u5e94\u7528\u7a0b\u5e8f\u7684\u8bed\u8a00\u3002<\/li>\n<\/ol>\n<p>\u4f7f\u7528Tauri\u6846\u67b6\uff0c\u8ba9\u6211\u4eec\u4e0d\u4ec5\u80fd\u83b7\u5f97Rust\u7684<strong>\u5b89\u5168\u6027<\/strong> \u548c<strong>\u9ad8\u6548\u6027<\/strong>\uff0c\u8fd8\u80fd\u4eab\u53d7Web\u5f00\u53d1\u7684\u719f\u6089\u611f\u548c\u7075\u6d3b\u6027\u3002<\/p>\n<p><img decoding=\"async\"   referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000046524324\" alt=\"\u56fe\u7247\" title=\"\u56fe\u7247\" loading=\"lazy\"><\/p>\n<h2>\u56db\u3001\u65b9\u6848\u4ecb\u7ecd<\/h2>\n<p>\u901a\u8fc7\u521a\u624d\u7684\u6280\u672f\u65b9\u6848\uff0c\u6211\u4eec\u6253\u9020\u51fa\u4e86FunProxy \u4e00\u7ad9\u5f0f\u4ee3\u7406\u5de5\u5177\u3002FunProxy \u662f\u4e00\u6b3e\u7528 Rust \u5f00\u53d1\u7684\u7eaf\u81ea\u7814\u7684\u4e00\u7ad9\u5f0f\u6293\u5305 \/&amp; \u4ee3\u7406\u5de5\u5177\uff0c\u5168\u5e73\u53f0\u652f\u6301\uff0c\u5929\u751f\u66f4\u5b89\u5168\uff0c\u5929\u751f\u66f4\u6d41\u7545\uff01\uff01\uff01<\/p>\n<p>\u4e3b\u6253\u4e00\u4e2a\u65b9\u4fbf\u3001\u5feb\u6377\u548c\u65e0\u8fb9\u754c\u3002<\/p>\n<p><img decoding=\"async\"   referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000046524325\" alt=\"\u56fe\u7247\" title=\"\u56fe\u7247\" loading=\"lazy\"><\/p>\n<h3>4.1 \u4f18\u52bf\u53ca\u4eae\u70b9<\/h3>\n<p>FunProxy \u4e3b\u8981\u7684\u4f18\u52bf\u53ca\u4eae\u70b9\u5982\u4e0b\uff1a<\/p>\n<ul>\n<li>\u5168\u529f\u80fd\u6293\u5305\u80fd\u529b<\/li>\n<li>\u5168\u5e73\u53f0\u72ec\u7acb\u5e94\u7528\u652f\u6301<\/li>\n<li>\u4e91\u7aef hosts<\/li>\n<li>\u4e91\u7aef Rules<\/li>\n<li>\u534f\u540c\u6293\u5305<\/li>\n<li>\u6781\u81f4\u6027\u80fd<\/li>\n<\/ul>\n<p><img decoding=\"async\"   referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000046524326\" alt=\"\u56fe\u7247\" title=\"\u56fe\u7247\" loading=\"lazy\"><\/p>\n<h4>4.1.1 \u5168\u529f\u80fd\u6293\u5305\u80fd\u529b<\/h4>\n<p><strong>\u534f\u8bae<\/strong><\/p>\n<p>\u652f\u6301HTTP\/1.x\u548cHTTP\/2\u534f\u8bae\u3001WebSocket\u3001TLS 1.1-1.3\u7684\u52a0\u5bc6\u534f\u8bae<\/p>\n<p><strong>\u5de5\u5177<\/strong><\/p>\n<p>\u652f\u6301\u91cd\u5199\u3001\u65ad\u70b9\u3001\u6570\u636e\u5bf9\u6bd4\u3001\u6a21\u62df\u8d85\u65f6\u3001\u5168\u5c40\u641c\u7d22\u3001\u7b5b\u9009\u3001\u5bf9\u6bd4<\/p>\n<p><strong>\u6587\u4ef6<\/strong><\/p>\n<p>\u652f\u6301\u5bfc\u5165\u5bfc\u51fa\u4f1a\u8bdd\u3001\u652f\u6301Fun\u683c\u5f0f\u7684\u6587\u4ef6\uff0cHAR\u683c\u5f0f\u6587\u4ef6\u3001Charles\u683c\u5f0f\u6587\u4ef6<\/p>\n<p><img decoding=\"async\"   referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000046524327\" alt=\"\u56fe\u7247\" title=\"\u56fe\u7247\" loading=\"lazy\"><\/p>\n<h4>4.1.2 \u5168\u5e73\u53f0\u72ec\u7acb\u5e94\u7528\u652f\u6301<\/h4>\n<p>\u6211\u4eec\u652f\u6301\u51e0\u4e4e\u6240\u6709\u7684\u4e3b\u6d41\u64cd\u4f5c\u7cfb\u7edf\uff0c\u4f8b\u5982Windows\/macOS\/Linux\/Android\/iOS\/\u8fd8\u6709\u7f51\u9875\u7248\u672c\uff0c\u5e76\u4e14\u591a\u64cd\u4f5c\u7cfb\u7edf\u53ef\u4ee5\u76f8\u4e92\u914d\u5408\uff0cFunProxy \u8ba9\u4ee3\u7406\u6253\u7834\u8fb9\u754c\u3002<\/p>\n<p><img decoding=\"async\"   referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000046524328\" alt=\"\u56fe\u7247\" title=\"\u56fe\u7247\" loading=\"lazy\"><\/p>\n<h4>4.1.3 \u4e91\u7aef hosts<\/h4>\n<p>hosts\u7ef4\u62a4\u662f\u4e00\u4e2a\u5927\u7684\u75db\u70b9\uff0c\u56e0\u4e3a\u5404\u4e2a\u7cfb\u7edf\u7684hosts\u4f1a\u7ecf\u5e38\u53d8\u5316\uff0c\u5bfc\u81f4\u6709\u4e9b\u540c\u5b66\u7684hosts\u56e0\u4e3a\u6ca1\u6709\u53ca\u65f6\u540c\u6b65\u53d8\u66f4\uff0c\u800c\u51fa\u73b0\u95ee\u9898\u3002\u6240\u4ee5\u6211\u4eec\u63d0\u4f9b\u4e86\u4e91\u7aefhosts\u529f\u80fd\u3002\u4e91\u7aefhosts \u53ef\u4ee5\u8ba9\u9879\u76ee\u4e2d\u7684hosts\u7531\u4e00\u4eba\u8bbe\u7f6e\uff0c\u4eba\u4eba\u5171\u4eab\u3002\u4fdd\u8bc1hosts\u80fd\u591f\u5b9e\u65f6\u540c\u6b65\u5230FunProxy\u7684\u5404\u4e2a\u7528\u6237\u3002<\/p>\n<p>\u4e91\u7aefhosts\u652f\u6301<strong>\u9759\u6001<\/strong> \u548c<strong>\u8fdc\u7a0b<\/strong>\u4e24\u79cdhosts\u3002<\/p>\n<p>**\u9759\u6001 hosts\uff1a**\u7cfb\u7edf\u4e2d\u7684hosts\u6587\u4ef6\u683c\u5f0f\u4e00\u6837\uff0c\u4e00\u4e00\u5bf9\u5e94\u3002<\/p>\n<p>**\u8fdc\u7a0bhosts\uff1a**\u53ef\u4ee5\u63d0\u4f9b\u4e00\u4e2a\u94fe\u63a5\uff0c\u6211\u4eec\u4f1a\u8fdc\u7a0b\u53bb\u62c9\u53d6\u8fd9\u4e2ahosts\uff0c\u5728FunProxy\u8fd0\u884c\u7684\u65f6\u5019\u518d\u53bb\u52a0\u8f7d\u8fd9\u4e2aHosts\u3002<\/p>\n<p>\u987a\u4fbf\u8bf4\u4e00\u53e5\uff1aFunProxy \u6240\u6709\u7684hosts\u90fd\u662f\u865a\u62dfhosts\uff0c\u5e76\u4e0d\u4f1a\u4fee\u6539\u7cfb\u7edfhosts\uff0c\u4fdd\u8bc1\u7cfb\u7edfhosts\u7684\u5e72\u51c0<\/p>\n<p><img decoding=\"async\"   referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000046524329\" alt=\"\u56fe\u7247\" title=\"\u56fe\u7247\" loading=\"lazy\"><\/p>\n<h4>4.1.4 \u4e91\u7aef\u89c4\u5219<\/h4>\n<p>\u540c\u4e91\u7aef hosts \u4e00\u6837\uff0c\u89c4\u5219\u4e5f\u53ef\u4ee5\u914d\u7f6e\u5230\u4e91\u7aef\u8ba9\u6240\u6709\u4eba\u5171\u4eab\u3002<\/p>\n<p><img decoding=\"async\"   referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000046524330\" alt=\"\u56fe\u7247\" title=\"\u56fe\u7247\" loading=\"lazy\"><\/p>\n<p>\u6240\u6709\u7684\u89c4\u5219\u90fd\u6709\u4e00\u4e9b\u516c\u5171\u7684\u914d\u7f6e\u3002\u6bd4\u5982\u89c4\u5219\u540d\u79f0\u3001\u5339\u914d\u6a21\u5f0f\u548c\u5339\u914d\u94fe\u63a5\u3002<\/p>\n<p>\u6211\u4eec\u7684\u5339\u914d\u6a21\u5f0f\u652f\u6301\u901a\u914d\u7b26\u548c\u6b63\u5219\u8868\u8fbe\u5f0f\u3002\u51e0\u4e4e\u53ef\u4ee5\u9002\u914d\u6240\u6709\u7684\u94fe\u63a5\u3002<\/p>\n<p>\u540c\u65f6\u6211\u4eec\u4e5f\u63d0\u4f9b\u4e86\u68c0\u6d4b\u5de5\u5177\uff0c\u5e2e\u52a9\u5927\u5bb6\u68c0\u6d4b\u94fe\u63a5\u662f\u5426\u88ab\u5339\u914d\u4e0a\u3002<\/p>\n<p><img decoding=\"async\"   referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000046524331\" alt=\"\u56fe\u7247\" title=\"\u56fe\u7247\" loading=\"lazy\"><\/p>\n<p>\u76ee\u524d\u89c4\u5219\u4e3b\u8981\u6709\u4e09\u4e2a\u5206\u7c7b\uff1a\u5206\u522b\u662f\u8fdc\u7a0b\u6620\u5c04\uff0c\u672c\u5730\u6620\u5c04\uff0c\u548c\u89e3\u5bc6\u3002<\/p>\n<p><strong>\u8fdc\u7a0b\u6620\u5c04<\/strong>\u5728\u8fdc\u7a0b\u6620\u5c04\u8fd9\u4e2a\u529f\u80fd\u4e0a\uff0c\u6211\u4eec\u53ef\u4ee5\u914d\u7f6e\u8fdc\u7a0b\u4e3b\u673a\u7684\u76f8\u5173\u4fe1\u606f\uff0c\u8fd9\u6837\u5c31\u53ef\u4ee5\u5c06\u9700\u8981\u8f6c\u53d1\u7684\u94fe\u63a5\u8f6c\u53d1\u5230\u5bf9\u5e94\u7684\u670d\u52a1\u5668\u4e0a\u9762\u3002<\/p>\n<p><strong>\u672c\u5730\u6620\u5c04<\/strong>\u5728\u672c\u5730\u6620\u5c04\u6a21\u5f0f\u4e2d\uff0c\u652f\u6301\u76f4\u63a5\u4fee\u6539\u672c\u5730\u6620\u5c04\u7684\u5185\u5bb9\uff0c\u540c\u65f6\u6211\u4eec\u63d0\u4f9b\u4e86\u5f3a\u5927\u7684\u4ee3\u7801\u7f16\u8f91\u5668\u529f\u80fd\uff0c\u5e2e\u52a9\u5927\u5bb6\u5728\u7f16\u5199\u672c\u5730\u6620\u5c04\u5185\u5bb9\u7684\u65f6\u5019\uff0c \u80fd\u591f\u6709\u6bd4\u8f83\u597d\u7684\u4ee3\u7801\u63d0\u793a\u3002<\/p>\n<p><strong>\u89e3\u5bc6\u529f\u80fd<\/strong>\u8fd9\u4e2a\u529f\u80fd\u5bf9\u4e8e\u5f88\u591a\u52a0\u5bc6\u4f20\u8f93\u7f51\u7ad9\u6d4b\u8bd5\u5c24\u4e3a\u91cd\u8981\u3002\u56e0\u4e3a\u6bcf\u4e2a\u7f51\u7ad9\u7684\u52a0\u89e3\u5bc6\u65b9\u5f0f\u53ef\u80fd\u4e0d\u4e00\u6837\uff0c\u6240\u6709\u6211\u4eec\u63d0\u4f9b\u4e86\u8fd0\u884c\u65f6\u51fd\u6570\u3002\u7528\u6237\u53ef\u4ee5\u81ea\u5df1\u7f16\u5199JavaScript\u6216\u8005Python\u8fd0\u884c\u51fd\u6570\uff0c\u52a8\u6001\u7684\u6839\u636e\u4f20\u5165\u7684\u53c2\u6570\u8fdb\u884c\u5bf9\u5e94\u7684\u52a0\u89e3\u5bc6\u8ba1\u7b97\u3002<\/p>\n<p>\u52a8\u6001\u51fd\u6570\u89e3\u6790\u8ba9 FunProxy \u51e0\u4e4e\u80fd\u89e3\u6240\u6709\u7684\u5bc6\u6587\uff0c\u8fd9\u6837\u6211\u4eec\u5728\u67e5\u770b\u63a5\u53e3\u7684\u65f6\u5019\u5c31\u975e\u5e38\u7684\u65b9\u4fbf\uff0c\u4e0d\u7528\u518d\u53bb\u89e3\u5bc6\u5de5\u5177\u4e2d\u67e5\u770b\u3002<\/p>\n<p>\u540c\u65f6\u4e5f\u8bf7\u5927\u5bb6\u653e\u5fc3\uff0c\u6211\u4eec\u7684\u89e3\u5bc6\u5de5\u5177\u6709\u7740\u975e\u5e38\u9ad8\u7684\u5b89\u5168\u6027\uff0c\u4fdd\u8bc1\u53ea\u6709\u9879\u76ee\u7ba1\u7406\u5458\u6388\u6743\u7684\u4eba\u624d\u80fd\u67e5\u770b\uff0c\u5927\u5bb6\u4e5f\u4e0d\u7528\u62c5\u5fc3\u81ea\u5df1\u7684\u89e3\u5bc6\u65b9\u6cd5\u88ab\u522b\u4eba\u76d7\u53d6\u3002<\/p>\n<p><img decoding=\"async\"   referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000046524332\" alt=\"\u56fe\u7247\" title=\"\u56fe\u7247\" loading=\"lazy\"><\/p>\n<h4>4.1.5 \u534f\u540c\u6293\u5305<\/h4>\n<p>\u901a\u8fc7 FunProxy \u5de6\u4e0b\u89d2\u63d0\u4f9b\u7684\u5206\u4eab\u529f\u80fd\uff0c\u53ef\u4ee5\u8ba9\u5f53\u524d\u6293\u5305\u7684\u6240\u6709\u6570\u636e\u5b9e\u65f6\u540c\u6b65\u7ed9\u6240\u6709\u62e5\u6709\u8fd9\u4e2a\u94fe\u63a5\u7684\u4eba\u3002\u6240\u6709\u7684\u64cd\u4f5c\u90fd\u80fd\u540c\u6b65\u5230\u6240\u6709\u7aef\uff0c\u65e0\u9700\u4e0b\u8f7d\uff0c\u8ba9\u5927\u5bb6\u66f4\u52a0\u65b9\u4fbf\u7684\u8fdb\u884c\u6570\u636e\u5305\u7684\u5171\u4eab\u3002<\/p>\n<p><img decoding=\"async\"   referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000046524333\" alt=\"\u56fe\u7247\" title=\"\u56fe\u7247\" loading=\"lazy\"><\/p>\n<h4>4.1.6 \u6781\u81f4\u6027\u80fd<\/h4>\n<p>\u6211\u4eec\u5bf9\u6bd4\u4e86\u5e02\u573a\u4e0a\u4e3b\u6d41\u7684\u6293\u5305\u8f6f\u4ef6\uff0c\u65e0\u8bba\u4ece\u5b89\u88c5\u5305\u5927\u5c0f\u3001\u542f\u52a8\u65f6\u95f4\u3001\u5b89\u88c5\u7a7a\u95f4\u3001\u4f7f\u7528\u5185\u5b58\u6765\u8bf4\uff0cFunProxy \u90fd\u6709\u975e\u5e38\u5927\u7684\u4f18\u52bf\u3002<\/p>\n<p><img decoding=\"async\"   referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000046524334\" alt=\"\u56fe\u7247\" title=\"\u56fe\u7247\" loading=\"lazy\"><\/p>\n<h3>4.2 \u6280\u672f\u67b6\u6784<\/h3>\n<p>FunProxy\u662f\u57fa\u4e8eTauri\u6846\u67b6\u8fdb\u884c\u8de8\u5e73\u53f0\u7684\u5f00\u53d1\uff0c\u6211\u4eec\u5c01\u88c5\u4e86fun-core \u548cfun-mitm\u4e24\u4e2a\u6838\u5fc3\u5e93\u3002<\/p>\n<p><strong>fun-core<\/strong>\u4e3b\u8981\u662f\u6240\u6709\u7aef\u7684\u516c\u5171\u80fd\u529b\uff0c\u6bd4\u5982\u914d\u7f6e\u6587\u4ef6\uff0c\u5b58\u50a8\u7b49\u3002<\/p>\n<p><strong>fun-mitm<\/strong>\u4e3b\u8981\u8d1f\u8d23\u6240\u6709\u7aef\u7684man in the middle \u4e5f\u5c31\u662f\u4e2d\u95f4\u4eba\u7684\u529f\u80fd\uff0c\u63d0\u4f9b\u6293\u5305\u7684\u6838\u5fc3\u80fd\u529b\u3002<\/p>\n<p><strong>tauri-plugin-funproxy<\/strong>\u56e0\u4e3a\u6709\u4e9b\u7aef\u7684\u529f\u80fd\u53ef\u80fd\u9700\u8981\u8c03\u7528\u7cfb\u7edf\u7279\u5b9a\u7684\u80fd\u529b\uff0c\u5728\u79fb\u52a8\u7aef\u6211\u4eec\u5c01\u88c5\u4e86tauri-plugin-funproxy\u6765\u8c03\u7528\u79fb\u52a8\u7aef\u7684\u7279\u5b9a\u80fd\u529b\uff0c\u6bd4\u5982VPN\u3002<\/p>\n<p><strong>\u5176\u4ed6<\/strong>\u5728\u5404\u4e2a\u684c\u9762\u7aef\u6211\u4eec\u5c01\u88c5\u4e86\u5404\u4e2a\u7cfb\u7edf\u7684\u6838\u5fc3crates\u6765\u8c03\u7528\u684c\u9762\u7aef\u7684\u7279\u5b9a\u80fd\u529b\u3002\u5176\u4ed6\u80fd\u529b\u5219\u662f\u901a\u8fc7Rust\u76f4\u63a5\u8c03\u7528\u3002<\/p>\n<p>\u4e3a\u4e86\u63d0\u4f9b\u4e91\u7aef\u80fd\u529b\uff0c\u6211\u4eec\u4f7f\u7528Go\u8bed\u8a00\u642d\u5efa\u4e86\u4e00\u4e2a\u670d\u52a1\u3002\u5305\u62ec\uff1a\u9879\u76ee\u7ba1\u7406\u3001\u7528\u6237\u7ba1\u7406\u3001\u5347\u7ea7\u7ba1\u7406\u3001\u5065\u5eb7\u68c0\u67e5\u3001\u4e91\u7aefHost\u3001\u4e91\u7aef\u89c4\u5219\u3001\u4e91\u7aef\u5de5\u5177\u7b49\u7b49\u529f\u80fd\u3002\u670d\u52a1\u53ea\u662f\u4e00\u4e2a\u589e\u503c\u529f\u80fd\uff0c\u6240\u6709\u7684FunProxy\u90fd\u53ef\u4ee5\u79bb\u7ebf\u8fd0\u884c\u3002<\/p>\n<p>\u540c\u65f6\u4e3a\u4e86\u4fdd\u8bc1\u5404\u7aefAPP\u6838\u5fc3\u80fd\u529b\u7684\u6b63\u5e38\uff0c\u4f7f\u7528\u4e86playwright\u642d\u5efa\u4e86\u81ea\u52a8\u5316\u6d4b\u8bd5\u80fd\u529b\u3002\u91cd\u70b9\u6d4b\u8bd5\u7684\u529f\u80fd\u6709\uff1a\u767b\u5f55\u3001\u4ee3\u7406\u3001\u6293\u5305\u3001\u5347\u7ea7\u3001\u6743\u9650\u3001\u517c\u5bb9\u6027\u3001\u6027\u80fd\u7b49\u3002<\/p>\n<p>\u6700\u540e\u901a\u8fc7vitepress\u642d\u5efaFunProxy\u7684\u6587\u6863\u529f\u80fd\u3002\u65b9\u4fbf\u7528\u6237\u4f7f\u7528\u548c\u67e5\u770b\u3002\u5305\u62ec\uff1a\u4ecb\u7ecd\u3001\u4f7f\u7528\u8bf4\u660e\u3001\u5e38\u89c1\u95ee\u9898\u3001\u66f4\u65b0\u65e5\u5fd7\u3001API\u3001\u8d21\u732e\u6307\u5357\u3001\u95ee\u9898\u53cd\u9988\u7b49\u3002<\/p>\n<p><img decoding=\"async\"   referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000046524335\" alt=\"\u56fe\u7247\" title=\"\u56fe\u7247\" loading=\"lazy\"><\/p>\n<h2>\u4e94\u3001\u6838\u5fc3\u5b9e\u73b0<\/h2>\n<h3>5.1 MITM<\/h3>\n<p>\u8fd9\u662fFunProxy\u7684MITM\uff08Man-in-the-Middle\uff0c\u4e2d\u95f4\u4eba\uff09\u65b9\u6848\u3002\u6240\u8c13\u7684\u4e2d\u95f4\u4eba\uff0c\u5c31\u662f\u5728\u670d\u52a1\u7aef\u548c\u5ba2\u6237\u7aef\u4e4b\u95f4\u52a0\u5165\u4e00\u4e2a\u8282\u70b9\uff0c\u8fd9\u4e2a\u8282\u70b9\u8d1f\u8d23\u63a5\u6536\u5ba2\u6237\u7aef\u53d1\u9001\u7684\u5185\u5bb9\uff0c\u901a\u8fc7\u81ea\u5df1\u7684\u89c4\u5219\u7136\u540e\u518d\u8f6c\u53d1\u5230\u670d\u52a1\u7aef\u3002\u6211\u4eec\u8fd9\u91cc\u7528HTTP\u548cHTTPS\u4e3e\u4f8b\uff1a<\/p>\n<p><img decoding=\"async\"   referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000046524336\" alt=\"\u56fe\u7247\" title=\"\u56fe\u7247\" loading=\"lazy\"><\/p>\n<p>HTTP\u4e2d\u95f4\u4eba\u65b9\u6848\uff1a<\/p>\n<p>\u5ba2\u6237\u7aef\u901a\u8fc7\u53d1\u9001HTTP\u5185\u5bb9\u5230FunProxy,FunProxy\u62ff\u5230HTTP\u5185\u5bb9\u540e\uff0c\u5728\u8f6c\u53d1\u5230\u670d\u52a1\u5668\u4e2d\u3002\u670d\u52a1\u5668\u5904\u7406\u5b8c\u6210\u540e\u518d\u5c06\u4fe1\u606f\u53d1\u9001\u7ed9FunProxy\uff0cFunProxy\u5728\u8f6c\u53d1\u7ed9\u5ba2\u6237\u7aef\u3002\u8fd9\u5c31\u5b8c\u6210\u4e86\u4e00\u4e2a\u8bf7\u6c42\u7684\u4e2d\u95f4\u4eba\u63a5\u6536\u548c\u8f6c\u53d1\u65b9\u6848\u3002<\/p>\n<p>\u7531\u4e8eHTTP\u90fd\u662f\u660e\u6587\u4f20\u8f93\uff0c\u6240\u4ee5\u6bd4\u8f83\u7b80\u5355\u3002HTTPS\u5c31\u6bd4\u8f83\u590d\u6742\u4e86\uff0c\u6d89\u53ca\u5230SSL\u8bc1\u4e66\u7684\u8ba4\u8bc1\uff0c\u5177\u4f53\u7684\u5927\u5bb6\u53ef\u4ee5\u770b\u56fe\u4e0a\u7684\u6d41\u7a0b\u3002<\/p>\n<p>\u4e86\u89e3\u5b8c\u4e86\u4e2d\u95f4\u4eba\u7684\u8fc7\u7a0b\u3002\u4e0b\u9762\u6211\u4eec\u6839\u636e\u521a\u624d\u5206\u6790\u7684\u8fc7\u7a0b\uff0c\u53ef\u4ee5\u8bbe\u8ba1\u51faFun-MITM\u7684\u6a21\u5757\u9700\u8981\u5305\u542b\u54ea\u4e9b\u6a21\u5757\u3002<\/p>\n<p>**CA\u6a21\u5757\uff1a**\u8d1f\u8d23\u6839\u8bc1\u4e66\u7684\u751f\u6210\u548c\u52a0\u8f7d\uff0c\u4ee5\u53ca\u5404\u4e2a\u7f51\u7ad9\u8bc1\u4e66\u7684\u8ba4\u8bc1<\/p>\n<p>**Client\uff1a**\u8fd9\u4e2aClient\u5c31\u662f\u6a21\u62df\u771f\u5b9e\u7528\u6237\u53d1\u9001\u8bf7\u6c42\u7684\u90a3\u4e2a\u5ba2\u6237\u7aef<\/p>\n<p>**Server\uff1a**\u8fd9\u4e2aServer\u5c31\u662f\u62e6\u622a\u7528\u6237\u8bf7\u6c42\u7684\u90a3\u4e2a\u670d\u52a1\u7aef<\/p>\n<p>**http_handler\uff1a**\u66f4\u6539\u8bf7\u6c42\u548c\u54cd\u5e94\u7684\u5185\u5bb9<\/p>\n<p>**socket_handker\uff1a**\u5904\u7406socket\u8bf7\u6c42<\/p>\n<p><img decoding=\"async\"   referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000046524337\" alt=\"\u56fe\u7247\" title=\"\u56fe\u7247\" loading=\"lazy\"><\/p>\n<pre><code>let mitm = Proxy::builder()\n    .with_addr(addr)\n    .with_client(client)\n    .with_ca(ca)\n    .with_http_handler(custom_handler.clone())\n    .with_websocket_handler(custom_handler.clone())\n    .with_graceful_shutdown(async {\n        close_rx.await.unwrap_or_default();\n    })\n    .build();\n\npub struct WantsHandlers&lt;C, CA, H, W, F&gt; {\n  al: AddrOrListener,\n  client: Client&lt;C, Body&gt;,\n  ca: CA,\n  http_handler: H,\n  websocket_handler: W,\n  websocket_connector: Option&lt;Connector&gt;,\n  server: Option&lt;Builder&lt;TokioExecutor&gt;&gt;,\n  graceful_shutdown: F,\n}\n\nimpl&lt;C, CA, H, W, F&gt; ProxyBuilder&lt;WantsHandlers&lt;C, CA, H, W, F&gt;&gt; {\n  \/\/\/ Set the HTTP handler.\n  pub fn with_http_handler&lt;H2: HttpHandler&gt;(\n      self,\n      http_handler: H2,\n  ) -&gt; ProxyBuilder&lt;WantsHandlers&lt;C, CA, H2, W, F&gt;&gt; {\n  }\n\n  \/\/\/ Set the WebSocket handler.\n  pub fn with_websocket_handler&lt;W2: WebSocketHandler&gt;(\n      self,\n      websocket_handler: W2,\n  ) -&gt; ProxyBuilder&lt;WantsHandlers&lt;C, CA, H, W2, F&gt;&gt; {\n  }\n\n  \/\/\/ Set the connector to use when connecting to WebSocket servers.\n  pub fn with_websocket_connector(self, connector: Connector) -&gt; Self {\n    \n  }\n\n  \/\/\/ Set a custom server builder to use for the proxy server.\n  pub fn with_server(self, server: Builder&lt;TokioExecutor&gt;) -&gt; Self {\n\n  }\n\n  \/\/\/ Set a future that when ready will gracefully shutdown the proxy server.\n  pub fn with_graceful_shutdown&lt;F2: Future&lt;Output = ()&gt; + Send + 'static&gt;(\n      self,\n      graceful_shutdown: F2,\n  ) -&gt; ProxyBuilder&lt;WantsHandlers&lt;C, CA, H, W, F2&gt;&gt; {\n    \n  }\n\n  \/\/\/ Build the proxy.\n  pub fn build(self) -&gt; Proxy&lt;C, CA, H, W, F&gt; {\n  }\n}\n<\/code><\/pre>\n<h3>5.2 \u865a\u62df hosts<\/h3>\n<p>\u5728\u4e2d\u95f4\u4eba\u65b9\u6848\u4e2d\u5982\u4f55\u5b9e\u73b0\u865a\u62dfHosts\u80fd\u529b?\u6211\u4eec\u5728\u5b9a\u4e49client\u7684\u65f6\u5019\uff0c\u53ef\u4ee5\u5b9a\u4e49\u4e00\u4e2aresolver\u3002\u8fd9\u4e2aresolver\u5728\u6bcf\u6b21hosts\u89e3\u6790\u7684\u65f6\u5019\u90fd\u4f1a\u8c03\u7528\u3002<\/p>\n<p>\u9996\u5148\u4ed6\u4f1a\u53bb\u4e91\u7aef\u83b7\u53d6\u5f53\u524dhosts\u7684\u914d\u7f6e\u7684IP\u662f\u54ea\u4e2a\uff0c\u5982\u679c\u6709\u7684\u8bdd\uff0c\u76f4\u63a5\u8fd4\u56de\u3002\u5982\u679c\u6ca1\u6709\u914d\u7f6e\uff0c\u90a3\u4e48\u8c03\u7528\u7cfb\u7edf\u7684loopup_ip\u51fd\u6570\u6765\u76f4\u63a5\u89e3\u6790hosts\u3002\u6700\u540e\u5c06\u89e3\u6790\u597d\u7684hosts\u8fd4\u56de\u3002<\/p>\n<p>\u5728\u5b9a\u4e49HttpConnector\u7684\u65f6\u5019\uff0c\u4f7f\u7528new_with_resolver\u52a0\u8f7d\u8fd9\u4e2adns-resolver\u3002\u8fd9\u5c31\u5b8c\u6210\u4e86\u4e00\u4e2a\u7b80\u5355\u7684\u81ea\u5b9a\u4e49dns-resolver\u3002<\/p>\n<p><img decoding=\"async\"   referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000046524338\" alt=\"\u56fe\u7247\" title=\"\u56fe\u7247\" loading=\"lazy\"><\/p>\n<pre><code>let resolver = tower::service_fn(move |name: Name| async move {\n    let ip_option = host::get_ip(name.as_str());\n    match ip_option {\n        Some(ip) =&gt; {\n            let ip: IpAddr = ip.parse().unwrap();\n            host::add(name.as_str(), ip.to_string().as_str());\n            Ok::&lt;_, Infallible&gt;(iter::once(SocketAddr::from((ip, 80))))\n        }\n        None =&gt; {\n            let sys_resolver = Resolver::from_system_conf().unwrap();\n            let future = spawn_blocking(move || {\n                let lookup_ip = sys_resolver.lookup_ip(name.as_str()).unwrap();\n                if let Some(ip) = lookup_ip.iter().next() {\n                    host::add(name.as_str(), ip.to_string().as_str());\n                    Ok(SocketAddr::from((ip, 80)))\n                } else {\n                    Err(&quot;No IP address found&quot;)\n                }\n            });\n\n            let addrs = future.await.unwrap().unwrap();\n            Ok::&lt;_, Infallible&gt;(iter::once(addrs))\n        }\n    }\n});\n\nlet mut http_connector = HttpConnector::new_with_resolver(resolver);\n<\/code><\/pre>\n<h3>5.3 \u81ea\u52a8\u5b89\u88c5\u8bc1\u4e66<\/h3>\n<p>\u5728\u4f7f\u7528FunProxy\u4e2d\u53ef\u4ee5\u81ea\u52a8\u5b89\u88c5\u5e76\u8bbe\u7f6e\u8bc1\u4e66\u4e3a\u4fe1\u4efb\u3002\u5177\u4f53\u7684\u662f\u5728macOS\u4e2d\u8c03\u7528security add-trusted-cert\u3002\u5728Windows\u4e2d\u4e3b\u8981\u8c03\u7528certutil\u65b9\u6cd5\u5177\u4f53\u7684\u547d\u4ee4\u884c\u548crust\u4ee3\u7801\u5982\u56fe\u7247\u6240\u793a\uff1a<\/p>\n<p><img decoding=\"async\"   referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000046524339\" alt=\"\u56fe\u7247\" title=\"\u56fe\u7247\" loading=\"lazy\"><\/p>\n<h3>5.4 \u6d41\u91cf\u62e6\u622a<\/h3>\n<p>\u63a5\u4e0b\u6765\u7ed9\u5927\u5bb6\u5206\u4eab\u4e00\u4e0b\u6211\u4eec\u662f\u600e\u4e48\u62e6\u622a\u6d41\u91cf\u7684\u3002\u9996\u5148\u662fPC\u7cfb\u7edf\uff0c\u6bd4\u5982Windows\/macOS\/Linux\u8fd9\u4e9b\u7cfb\u7edf\u4e0a\uff0cAPP\u6388\u6743\u540e\u53ef\u4ee5\u83b7\u53d6\u5f88\u9ad8\u7684\u6743\u9650\uff0c\u6240\u4ee5\u6211\u4eec\u76f4\u63a5\u8c03\u7528\u7cfb\u7edf\u63d0\u4f9b\u7684\u63a5\u53e3\u80fd\u529b\u3002<\/p>\n<p><img decoding=\"async\"   referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000046524340\" alt=\"\u56fe\u7247\" title=\"\u56fe\u7247\" loading=\"lazy\"><\/p>\n<p>\u6bd4\u5982\u5728macOS\u4e0a\u9762\u5c31\u662f\u901a\u8fc7networksetup\u8fd9\u4e2a\u547d\u4ee4\u884c\u5de5\u5177\u5b9e\u73b0\u5bf9\u7cfb\u7edf\u4ee3\u7406\u7684\u8bbe\u7f6e\uff0c\u5728Windows\u4e0a\u9762\u53ef\u4ee5\u901a\u8fc7ProxyServer\u8bbe\u7f6e\u3002<\/p>\n<p><img decoding=\"async\"   referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000046524341\" alt=\"\u56fe\u7247\" title=\"\u56fe\u7247\" loading=\"lazy\"><\/p>\n<p><img decoding=\"async\"   referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000046524342\" alt=\"\u56fe\u7247\" title=\"\u56fe\u7247\" loading=\"lazy\"><\/p>\n<p>\u800c\u5728\u79fb\u52a8\u7aefAPP\u4e0a\u9762\uff0c\u4e00\u822cAPP\u7684\u6743\u9650\u7279\u522b\u4f4e\uff0cAPP\u6ca1\u6709\u76f4\u63a5\u8bbe\u7f6e\u7cfb\u7edf\u4ee3\u7406\u7684\u80fd\u529b\uff0c\u6240\u4ee5\u6211\u4eec\u91c7\u7528\u7684\u662f\u901a\u8fc7VPN\u7684\u65b9\u5f0f\u6765\u5b9e\u73b0\u6d41\u91cf\u7684\u62e6\u622a\u4e0e\u8f6c\u53d1\u3002<\/p>\n<p>\u6211\u4eec\u901a\u8fc7VpnService\u6765\u521b\u5efaVPN\u670d\u52a1\u3002\u7136\u540e\u8c03\u7528VpnService\u7684\u5404\u79cd\u80fd\u529b\u3002<\/p>\n<p>\u8fd9\u91cc\u6211\u4eec\u7528\u4e86\u4e00\u4e2a\u5b89\u5353Vpn\u7684setHttpProxy\u65b9\u6cd5\uff0c\u5c31\u53ef\u4ee5\u5c06\u6240\u6709\u7684\u6d41\u91cf\u4e3b\u52a8\u6253\u5230\u6211\u4eec\u7684fun-mitm \u670d\u52a1\u5668\u4e0a\u9762\u3002fun-mitm \u5728\u901a\u8fc7\u81ea\u5df1\u7684\u89c4\u5219\u5bf9\u6240\u6709\u7684\u6d41\u91cf\u8fdb\u884c\u5904\u7406\uff0c\u5305\u62ecDNS\u89e3\u6790\u6216\u8005\u8bf7\u6c42\u54cd\u5e94\u7684\u4fee\u6539\u7b49\u7b49\u3002<\/p>\n<p><img decoding=\"async\"   referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000046524343\" alt=\"\u56fe\u7247\" title=\"\u56fe\u7247\" loading=\"lazy\"><\/p>\n<h3>5.5 \u8c03\u7528\u7cfb\u7edf\u80fd\u529b<\/h3>\n<p>\u6211\u4eec\u4ee5macOS\u5e94\u7528\u6c89\u6d78\u5f0f\u5934\u90e8\u4e3a\u4f8b\u7ed9\u5927\u5bb6\u505a\u4e2a\u5206\u4eab\u3002\u5728macOS\u5e94\u7528\u8bbe\u8ba1\u4e2d\uff0c\u5176\u5b9e\u66f4\u52a0\u901a\u7528\u6027\u7684\u8bbe\u8ba1\u662f\u6c89\u6d78\u5f0f\u7684\u5934\u90e8\uff0c\u800cTauri\u751f\u6210\u7684\u5e94\u7528\uff0c\u9ed8\u8ba4\u90fd\u4f1a\u6709\u4e00\u4e2a\u5934\u90e8\uff0c\u5982\u5c4f\u5e55\u4e0a\u9ec4\u8272\u6240\u793a\uff0c\u8fd9\u4e2a\u5934\u90e8\u5176\u5b9e\u6ca1\u591a\u5c11\u4f5c\u7528\u3002\u63a5\u4e0b\u6765\u6211\u5c06\u7528\u8fd9\u4e2a\u4f8b\u5b50\uff0c\u7ed9\u5927\u5bb6\u5206\u4eab\u4e00\u4e0b\u5728 Rust \u4e2d\u5982\u4f55\u901a\u8fc7\u8c03\u7528\u7cfb\u7edf\u7684\u539f\u751f\u7684\u80fd\u529b\uff0c\u6765\u53bb\u6389\u8fd9\u4e2a\u5934\u90e8\u3002<\/p>\n<p><img decoding=\"async\"   referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000046524344\" alt=\"\u56fe\u7247\" title=\"\u56fe\u7247\" loading=\"lazy\"><\/p>\n<ol>\n<li>\u6211\u4eec\u901a\u8fc7 cargo new macos &#8211;lib \u521b\u5efa\u4e00\u4e2alib\u5e93\u3002\u5728lib\u5e93\u4e2d\u65b0\u5efa\u4e00\u4e2awindow.swift\u6587\u4ef6\uff0c\u4e3b\u8981\u4f7f\u7528window.titlebarAppearsTransparent\u65b9\u6cd5\u6765\u8bbe\u7f6e\u900f\u660e\u5ea6\u3002<\/li>\n<li>\u63a5\u7740\u5728lib\u4e2d\u901a\u8fc7swift_rs\u4e2d\u7684swift\u5b8f\u6765\u8c03\u7528\u8fd9\u4e2a\u51fd\u6570\uff0c\u5e76\u5c06\u8fd9\u4e2a\u51fd\u6570\u8bbe\u7f6e\u4e3apub\u7ed9\u5176\u4ed6\u65b9\u6cd5\u8c03\u7528\u3002<\/li>\n<li>\u7ed9\u8fd9\u4e2a lib \u6dfb\u52a0 build.rs \u6765\u7f16\u8bd1\u8fd9\u4e2a\u5e93\u3002\u53ef\u4ee5\u6307\u5b9amacOS\u7684\u7248\u672c\u7b49\u5176\u4ed6\u5185\u5bb9\u3002\u6700\u540e\u6211\u4eec\u5728\u81ea\u5df1\u7684\u9879\u76ee\u4e2d\u5c31\u53ef\u4ee5\u76f4\u63a5\u5f15\u5165\u8fd9\u4e2alib\u5e93\u3002\u76f4\u63a5\u8c03\u7528\u91cc\u9762\u7684set_titlebar_style\u65b9\u6cd5\u3002\u4ece\u800c\u901a\u8fc7swift_rs\u8c03\u7528macOS\u4e2d\u7684\u539f\u751f\u80fd\u529b\u3002<\/li>\n<\/ol>\n<p><img decoding=\"async\"   referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000046524345\" alt=\"\u56fe\u7247\" title=\"\u56fe\u7247\" loading=\"lazy\"><\/p>\n<h3>5.6 \u534f\u540c\u6293\u5305<\/h3>\n<p>\u534f\u540c\u6293\u5305\u80fd\u591f\u8ba9\u4e00\u7aef\u7684\u6293\u5305\u6570\u636e\uff0c\u901a\u8fc7\u94fe\u63a5\u5206\u4eab\u7684\u65b9\u5f0f\uff0c\u5b9e\u65f6\u540c\u6b65\u7ed9\u5176\u4ed6\u6240\u6709\u62e5\u6709\u8fd9\u4e2a\u94fe\u63a5\u7684\u4eba\u3002<\/p>\n<p>\u4e3b\u8981\u6838\u5fc3\u662f\u6211\u4eec\u7684fun-core\u8fd9\u4e2a\u5e93\u3002\u901a\u8fc7fun-core\u8fd9\u4e2a\u5e93\u542f\u52a8\u7684\u65f6\u5019\u6211\u4eec\u4f1a\u542f\u52a8\u4e24\u4e2a\u670d\u52a1\uff0c\u4e00\u4e2a\u662fapi,\u8d1f\u8d23\u63a5\u53e3\u670d\u52a1\u3002<\/p>\n<p>\u53e6\u4e00\u4e2a\u5c31\u662f\u4f1a\u542f\u52a8websocket\u670d\u52a1\u3002\u7528\u6237\u6253\u5f00\u5206\u4eab\u8fc7\u6765\u7684\u94fe\u63a5\uff0c\u4f1a\u81ea\u52a8\u901a\u6d4f\u89c8\u5668\u7684websocket\u65b9\u6cd5\u6765\u76f4\u63a5\u5bf9fun-core\u7684websocket\u8fdb\u884c\u901a\u8baf\u3002\u5f53\u6709\u65b0\u7684\u6293\u5305\u6570\u636e\u4ea7\u751f\u7684\u65f6\u5019\uff0cfun-core\u4f1a\u901a\u8fc7websocket\u63a8\u9001\u7ed9\u6240\u6709\u5f53\u524d\u8fde\u63a5\u7684\u7528\u6237\u3002\u4ece\u800c\u8fbe\u5230\u4e00\u7aef\u6293\u5305\uff0c\u591a\u7aef\u540c\u6b65\u7684\u529f\u80fd\u3002<\/p>\n<p><img decoding=\"async\"   referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000046524346\" alt=\"\u56fe\u7247\" title=\"\u56fe\u7247\" loading=\"lazy\"><\/p>\n<h2>\u516d\u3001\u89c4\u5212\u603b\u7ed3<\/h2>\n<h3>6.1 \u89c4\u5212<\/h3>\n<p>\u63a5\u4e0b\u6765\u6211\u4eec\u91cd\u70b9\u6295\u5165\u7684\u662fworkflow\u8fd9\u4e2a\u529f\u80fd\uff0c\u652f\u6301\u5bf9\u8bf7\u6c42\u54cd\u5e94\u7684\u5168\u751f\u547d\u5468\u671f\u7ba1\u7406\u3002\u7528\u6237\u53ef\u4ee5\u76f4\u89c2\u7684\u9009\u62e9\u60f3\u8981\u7684\u5de5\u5177\uff0c\u5e76\u6784\u5efa\u5de5\u4f5c\u6d41\u5bf9\u8bf7\u6c42\u54cd\u5e94\u8fdb\u884c\u5904\u7406\u3002\u5de5\u4f5c\u6d41\u4e0d\u4ec5\u652f\u6301\u8bf7\u6c42\u54cd\u5e94\u7684\u5904\u7406\uff0c\u8fd8\u652f\u6301\u903b\u8f91\u7684\u5224\u65ad\uff0c\u6bd4\u5982\u5c06\u7b26\u5408\u67d0\u79cd\u6761\u4ef6\u4e0b\u7684\u8bf7\u6c42\u9ad8\u4eae\u663e\u793a\u51fa\u6765\u3002\u7b49\u7b49\uff0c\u53ef\u73a9\u6027\u66f4\u9ad8\u3002<\/p>\n<p><img decoding=\"async\"   referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000046524347\" alt=\"\u56fe\u7247\" title=\"\u56fe\u7247\" loading=\"lazy\"><\/p>\n<h3>6.2 \u603b\u7ed3<\/h3>\n<p>\u901a\u8fc7\u4e0a\u9762\u6211\u4eec\u5bf9FunProxy\u7684\u4ecb\u7ecd\uff0c\u76f8\u4fe1\u5927\u5bb6\u5bf9FunProxy\u6709\u4e86\u6bd4\u8f83\u4e0d\u9519\u7684\u4e86\u89e3\u3002FunProxy\u4f7f\u7528 Rust \u6784\u5efa\u7684\u8de8\u5e73\u53f0\u5168\u94fe\u8def\u6d4b\u8bd5\/&amp;\u6293\u5305\u4ee3\u7406\u5de5\u5177\u3002\u901a\u8fc7FunProxy,\u6211\u4eec\u53ea\u9700\u8981\u7b80\u5355\u7684\u901a\u8fc7\u9009\u62e9\uff0c\u6bd4\u5982\u9009\u62e9\u9879\u76ee\uff0c\u9009\u62e9\u73af\u5883\uff0c\u9009\u62e9\u89c4\u5219\uff0c\u5c31\u80fd\u5c06\u5168\u94fe\u8def\u6d4b\u8bd5\u8fc7\u7a0b\u4e2d\u590d\u6742\u7684\u914d\u7f6e\u6d41\u7a0b\uff0c\u53d8\u5f97\u5f02\u5e38\u7684\u7b80\u5355\u3002\u540c\u65f6\u901a\u8fc7\u4e91\u7aef\u529f\u80fd\u8ba9\u6240\u6709\u4eba\u80fd\u591f\u5171\u4eab\u914d\u7f6e\uff0c\u6781\u5927\u7684\u63d0\u5347\u5168\u94fe\u8def\u6d4b\u8bd5\u7684\u73af\u5883\u914d\u7f6e\u548c\u6293\u5305\u6548\u7387\uff0c\u8ba9\u5168\u94fe\u8def\u6d4b\u8bd5\u53d8\u5f97\u66f4\u52a0\u4e1d\u6ed1\u6d41\u7545\u3002<\/p>\n<p><a href=\"https:\/\/segmentfault.com\/a\/1190000046524315\">https:\/\/segmentfault.com\/a\/1190000046524315<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4f5c\u8005\uff1avivo \u4e92\u8054\u7f51\u5927\u524d\u7aef\u56e2\u961f- Song Jiachao \u5728\u8f6f\u4ef6\u5f00\u53d1\u8fc7\u7a0b\u4e2d\uff0c\u8f6f\u4ef6\u6d4b\u8bd5\u5bf9\u4e8e\u4fdd\u969c\u8f6f\u4ef6\u8d28\u91cf\u548c\u7528\u6237 [&hellip;]<\/p>\n","protected":false},"author":8,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4],"tags":[],"class_list":["post-10020791","post","type-post","status-publish","format-standard","hentry","category-share"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts\/10020791","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10020791"}],"version-history":[{"count":0,"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts\/10020791\/revisions"}],"wp:attachment":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10020791"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10020791"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10020791"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}