{"id":1429,"date":"2026-10-15T09:40:39","date_gmt":"2026-10-15T01:40:39","guid":{"rendered":"https:\/\/www.suannai.link\/blog\/xray%e6%a0%b8%e5%bf%83%e5%8a%9f%e8%83%bd%e4%bb%8b%e7%bb%8d%e9%85%8d%e7%bd%ae%e5%a4%b1%e8%b4%a5%e6%80%8e%e4%b9%88%e5%8a%9e%ef%bc%9a%e6%8e%92%e6%9f%a5%e4%b8%8e%e8%a7%a3%e5%86%b3\/"},"modified":"2026-10-15T09:40:39","modified_gmt":"2026-10-15T01:40:39","slug":"xray%e6%a0%b8%e5%bf%83%e5%8a%9f%e8%83%bd%e4%bb%8b%e7%bb%8d%e9%85%8d%e7%bd%ae%e5%a4%b1%e8%b4%a5%e6%80%8e%e4%b9%88%e5%8a%9e%ef%bc%9a%e6%8e%92%e6%9f%a5%e4%b8%8e%e8%a7%a3%e5%86%b3","status":"publish","type":"post","link":"https:\/\/www.suannai.link\/blog\/xray%e6%a0%b8%e5%bf%83%e5%8a%9f%e8%83%bd%e4%bb%8b%e7%bb%8d%e9%85%8d%e7%bd%ae%e5%a4%b1%e8%b4%a5%e6%80%8e%e4%b9%88%e5%8a%9e%ef%bc%9a%e6%8e%92%e6%9f%a5%e4%b8%8e%e8%a7%a3%e5%86%b3\/","title":{"rendered":"Xray\u6838\u5fc3\u529f\u80fd\u4ecb\u7ecd\u914d\u7f6e\u5931\u8d25\u600e\u4e48\u529e\uff1a\u6392\u67e5\u4e0e\u89e3\u51b3"},"content":{"rendered":"<p>\u5f53\u4f60\u5728\u914d\u7f6e Xray \u65f6\u9047\u5230\u8fde\u63a5\u5931\u8d25\u3001\u534f\u8bae\u62a5\u9519\u6216\u65e0\u6cd5\u89e3\u6790\u57df\u540d\u7b49\u95ee\u9898\uff0c\u901a\u5e38\u4e0d\u662f\u6838\u5fc3\u4ee3\u7801\u672c\u8eab\u7684\u7f3a\u9677\uff0c\u800c\u662f\u5ba2\u6237\u7aef\u914d\u7f6e\u4e0e\u670d\u52a1\u5668\u7aef\u53c2\u6570\u4e0d\u5339\u914d\uff0c\u6216\u672c\u5730\u7f51\u7edc\u73af\u5883\u62e6\u622a\u6240\u81f4\u3002Xray \u4f5c\u4e3a\u9ad8\u6027\u80fd\u7684\u4ee3\u7406\u6838\u5fc3\uff0c\u5176\u914d\u7f6e\u903b\u8f91\u4e25\u8c28\uff0c\u4efb\u4f55\u7ec6\u5fae\u7684\u53c2\u6570\u9519\u8bef\uff08\u5982\u7aef\u53e3\u3001ID\u3001\u4f20\u8f93\u534f\u8bae\uff09\u90fd\u4f1a\u5bfc\u81f4\u63e1\u624b\u5931\u8d25\u3002<\/p>\n<p>\u672c\u6587\u5c06\u76f4\u63a5\u9488\u5bf9\u914d\u7f6e\u5931\u8d25\u7684\u5e38\u89c1\u73b0\u8c61\uff0c\u68b3\u7406\u6392\u67e5\u987a\u5e8f\uff0c\u5e76\u63d0\u4f9b\u5177\u4f53\u7684\u89e3\u51b3\u6b65\u9aa4\u3002\u6211\u4eec\u5c06\u91cd\u70b9\u5206\u6790 Xray \u7684\u6838\u5fc3\u529f\u80fd\u7279\u6027\u5982\u4f55\u5f71\u54cd\u914d\u7f6e\uff0c\u4ee5\u53ca\u5728\u4e0d\u540c\u7f51\u7edc\u73af\u5883\u4e0b\u5982\u4f55\u5feb\u901f\u5b9a\u4f4d\u5e76\u4fee\u590d\u914d\u7f6e\u9519\u8bef\u3002<\/p>\n<h2>Xray \u6838\u5fc3\u529f\u80fd\u4e0e\u914d\u7f6e\u903b\u8f91\u57fa\u7840<\/h2>\n<p>\u5728\u6392\u67e5\u6545\u969c\u524d\uff0c\u5fc5\u987b\u7406\u89e3 Xray \u7684\u6838\u5fc3\u67b6\u6784\u3002Xray \u662f\u4e00\u4e2a\u6a21\u5757\u5316\u7684\u9ad8\u6027\u80fd\u7f51\u7edc\u4ee3\u7406\u5de5\u5177\uff0c\u5176\u914d\u7f6e\u6838\u5fc3\u5728\u4e8e `config.json` \u6587\u4ef6\u3002\u4e0e\u65e9\u671f\u7248\u672c\u76f8\u6bd4\uff0cXray \u5f15\u5165\u4e86 XTLS \u7cfb\u5217\u534f\u8bae\uff08\u5982 XTLS-RPRX-FLOW\uff09\u548c\u66f4\u7075\u6d3b\u7684\u4f20\u8f93\u534f\u8bae\u652f\u6301\uff0c\u8fd9\u8981\u6c42\u914d\u7f6e\u8005\u5fc5\u987b\u660e\u786e\u6bcf\u4e2a\u6a21\u5757\u7684\u4f5c\u7528\u3002<\/p>\n<p>Xray \u7684\u4e3b\u8981\u529f\u80fd\u6a21\u5757\u5305\u62ec\uff1a<br \/>\u2022 <strong>Inbound\uff08\u5165\u7ad9\uff09<\/strong>\uff1a\u5b9a\u4e49\u670d\u52a1\u5668\u5982\u4f55\u63a5\u6536\u5ba2\u6237\u7aef\u8fde\u63a5\uff0c\u5305\u62ec\u76d1\u542c\u7aef\u53e3\u3001\u534f\u8bae\u7c7b\u578b\uff08\u5982 VMess, VLESS, Trojan, SOCKS\uff09\u548c\u8ba4\u8bc1\u65b9\u5f0f\u3002<br \/>\u2022 <strong>Outbound\uff08\u51fa\u7ad9\uff09<\/strong>\uff1a\u5b9a\u4e49\u670d\u52a1\u5668\u5982\u4f55\u8f6c\u53d1\u6d41\u91cf\u5230\u76ee\u6807\u7f51\u7edc\uff0c\u901a\u5e38\u7528\u4e8e\u591a\u8df3\u6216\u94fe\u5f0f\u4ee3\u7406\u573a\u666f\u3002<br \/>\u2022 <strong>Routing\uff08\u8def\u7531\uff09<\/strong>\uff1a\u5b9a\u4e49\u6d41\u91cf\u5206\u53d1\u89c4\u5219\uff0c\u51b3\u5b9a\u54ea\u4e9b\u6d41\u91cf\u8d70\u4ee3\u7406\uff0c\u54ea\u4e9b\u8d70\u76f4\u8fde\u3002<br \/>\u2022 <strong>Dns\uff08DNS\uff09<\/strong>\uff1a\u5904\u7406\u57df\u540d\u89e3\u6790\uff0c\u5bf9\u4e8e\u7ed5\u8fc7\u672c\u5730 DNS \u6c61\u67d3\u81f3\u5173\u91cd\u8981\u3002<br \/>\u2022 <strong>Transport\uff08\u4f20\u8f93\uff09<\/strong>\uff1a\u5b9a\u4e49\u5e95\u5c42\u7684\u4f20\u8f93\u65b9\u5f0f\uff0c\u5982 TCP, mKCP, WebSocket, HTTP\/2, QUIC \u7b49\u3002<\/p>\n<p><a href=\"https:\/\/www.suannai.link\/blog\/xray%e6%a0%b8%e5%bf%83%e5%8a%9f%e8%83%bd%e4%bb%8b%e7%bb%8d%e4%b8%8d%e8%83%bd%e7%94%a8%e4%ba%86%e6%80%8e%e4%b9%88%e5%8a%9e%ef%bc%9a%e6%95%85%e9%9a%9c%e6%8e%92%e6%9f%a5%e4%b8%8e%e4%bf%ae%e5%a4%8d\/\" target=\"_blank\" rel=\"noopener\">\u914d\u7f6e\u5931\u8d25<\/a>\u7684\u6839\u672c\u539f\u56e0\u5f80\u5f80\u5728\u4e8e\u8fd9\u4e9b\u6a21\u5757\u4e4b\u95f4\u7684\u53c2\u6570\u4e0d\u4e00\u81f4\u3002\u4f8b\u5982\uff0cInbound \u58f0\u660e\u4f7f\u7528 WebSocket\uff0c\u4f46 Transport \u4e2d\u672a\u914d\u7f6e WebSocket \u7684\u8def\u5f84\u548c\u4f2a\u88c5\u57df\u540d\uff0c\u6216\u8005\u5ba2\u6237\u7aef\u7684 Inbound \u7aef\u53e3\u4e0e\u670d\u52a1\u5668\u7aef Outbound \u7684\u76d1\u542c\u7aef\u53e3\u4e0d\u5339\u914d\u3002<\/p>\n\n<h2>\u5e38\u89c1\u914d\u7f6e\u5931\u8d25\u73b0\u8c61\u4e0e\u539f\u56e0\u5206\u6790<\/h2>\n<p>\u914d\u7f6e\u5931\u8d25\u7684\u8868\u73b0\u5f62\u5f0f\u591a\u79cd\u591a\u6837\uff0c\u4e0d\u540c\u7684\u62a5\u9519\u4fe1\u606f\u6307\u5411\u4e0d\u540c\u7684\u6545\u969c\u70b9\u3002\u4ee5\u4e0b\u662f\u51e0\u79cd\u6700\u5e38\u89c1\u7684\u5931\u8d25\u73b0\u8c61\u53ca\u5176\u80cc\u540e\u7684\u6280\u672f\u539f\u56e0\u3002<\/p>\n<table style=\"width:100%;border-collapse:collapse;margin:24px 0;\">\n<thead>\n<tr>\n<th style=\"border:1px solid #ddd;padding:10px;background:#f7f7f7;text-align:left;\">\u6545\u969c\u73b0\u8c61<\/th>\n<th style=\"border:1px solid #ddd;padding:10px;background:#f7f7f7;text-align:left;\">\u53ef\u80fd\u539f\u56e0<\/th>\n<th style=\"border:1px solid #ddd;padding:10px;background:#f7f7f7;text-align:left;\">\u6392\u67e5\u65b9\u5411<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\"><strong>\u8fde\u63a5\u8d85\u65f6 \/ \u63e1\u624b\u5931\u8d25<\/strong><\/td>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">\u7aef\u53e3\u672a\u5f00\u653e\u3001\u9632\u706b\u5899\u62e6\u622a\u3001\u534f\u8bae\u4e0d\u5339\u914d\u3001TLS \u8bc1\u4e66\u9519\u8bef<\/td>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">\u68c0\u67e5\u7aef\u53e3\u8fde\u901a\u6027\u3001\u786e\u8ba4\u534f\u8bae\u7c7b\u578b\u3001\u9a8c\u8bc1\u8bc1\u4e66\u94fe<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\"><strong>\u534f\u8bae\u9519\u8bef \/ \u975e\u6cd5\u8bf7\u6c42<\/strong><\/td>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">\u5ba2\u6237\u7aef\u4e0e\u670d\u52a1\u7aef\u7248\u672c\u4e0d\u517c\u5bb9\u3001ID \u9519\u8bef\u3001\u52a0\u5bc6\u65b9\u5f0f\u9519\u8bef<\/td>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">\u6838\u5bf9 UUID\/ID\u3001\u68c0\u67e5\u52a0\u5bc6\u7b97\u6cd5\uff08\u5982 auto, aes-128-gcm\uff09<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\"><strong>DNS \u89e3\u6790\u5931\u8d25 \/ \u65e0\u6cd5\u6253\u5f00\u7f51\u9875<\/strong><\/td>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">\u672c\u5730 DNS \u6c61\u67d3\u3001Xray DNS \u914d\u7f6e\u7f3a\u5931\u3001\u8def\u7531\u89c4\u5219\u9519\u8bef<\/td>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">\u68c0\u67e5 DNS \u670d\u52a1\u5668\u8bbe\u7f6e\u3001\u9a8c\u8bc1\u8def\u7531\u89c4\u5219\u4f18\u5148\u7ea7<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\"><strong>\u8fde\u63a5\u4e0d\u7a33\u5b9a \/ \u9891\u7e41\u65ad\u5f00<\/strong><\/td>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">\u4f20\u8f93\u534f\u8bae\u9009\u62e9\u4e0d\u5f53\u3001MTU \u8bbe\u7f6e\u9519\u8bef\u3001\u7f51\u7edc\u62e5\u585e<\/td>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">\u5207\u6362\u4f20\u8f93\u534f\u8bae\uff08\u5982 TCP \u6539 WebSocket\uff09\u3001\u8c03\u6574 MTU<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\"><strong>\u65e5\u5fd7\u663e\u793a &#8220;Invalid Request&#8221;<\/strong><\/td>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">\u5ba2\u6237\u7aef\u914d\u7f6e\u683c\u5f0f\u9519\u8bef\u3001\u7f3a\u5c11\u5fc5\u8981\u5b57\u6bb5\u3001JSON \u8bed\u6cd5\u9519\u8bef<\/td>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">\u4f7f\u7528\u5728\u7ebf JSON \u6821\u9a8c\u5de5\u5177\u68c0\u67e5\u914d\u7f6e\u6587\u4ef6<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><\/p>\n<h3>1. \u8fde\u63a5\u8d85\u65f6\u4e0e\u63e1\u624b\u5931\u8d25<\/h3>\n<p>\u8fd9\u662f\u6700\u5178\u578b\u7684\u914d\u7f6e\u9519\u8bef\u3002\u5f53\u5ba2\u6237\u7aef\u5c1d\u8bd5\u8fde\u63a5\u670d\u52a1\u5668\u65f6\uff0c\u6570\u636e\u5305\u65e0\u6cd5\u5230\u8fbe\u670d\u52a1\u5668\uff0c\u6216\u670d\u52a1\u5668\u62d2\u7edd\u8fde\u63a5\u3002<\/p>\n<p>* <strong>\u7aef\u53e3\u672a\u5f00\u653e<\/strong>\uff1a\u786e\u4fdd\u670d\u52a1\u5668\u9632\u706b\u5899\uff08\u5982 UFW, iptables, \u4e91\u670d\u52a1\u5546\u5b89\u5168\u7ec4\uff09\u5df2\u653e\u884c\u914d\u7f6e\u7684\u5165\u7ad9\u7aef\u53e3\u3002<br \/>* <strong>\u534f\u8bae\u4e0d\u5339\u914d<\/strong>\uff1a\u5ba2\u6237\u7aef\u9009\u62e9\u7684\u534f\u8bae\uff08\u5982 VLESS\uff09\u5fc5\u987b\u4e0e\u670d\u52a1\u5668\u7aef Inbound \u5b9a\u4e49\u7684\u534f\u8bae\u4e00\u81f4\u3002\u5982\u679c\u670d\u52a1\u5668\u7aef\u914d\u7f6e\u4e3a Trojan\uff0c\u800c\u5ba2\u6237\u7aef\u9009\u62e9 VLESS\uff0c\u8fde\u63a5\u5c06\u76f4\u63a5\u5931\u8d25\u3002<br \/>* <strong>TLS \u8bc1\u4e66\u95ee\u9898<\/strong>\uff1a\u5982\u679c\u4f7f\u7528 TLS \u52a0\u5bc6\uff08\u5982 WSS\uff09\uff0c\u786e\u4fdd\u8bc1\u4e66\u6587\u4ef6\u8def\u5f84\u6b63\u786e\uff0c\u4e14\u57df\u540d\u4e0e\u8bc1\u4e66 SAN\uff08Subject Alternative Name\uff09\u5339\u914d\u3002\u8bc1\u4e66\u8fc7\u671f\u6216\u81ea\u7b7e\u540d\u8bc1\u4e66\u5728\u4e25\u683c\u6a21\u5f0f\u4e0b\u4f1a\u5bfc\u81f4\u63e1\u624b\u5931\u8d25\u3002<\/p>\n<h3>2. \u534f\u8bae\u9519\u8bef\u4e0e\u975e\u6cd5\u8bf7\u6c42<\/h3>\n<p>\u5f53\u8fde\u63a5\u5efa\u7acb\u4f46\u6570\u636e\u4f20\u8f93\u88ab\u62d2\u7edd\u65f6\uff0c\u901a\u5e38\u8868\u73b0\u4e3a\u534f\u8bae\u9519\u8bef\u3002<\/p>\n<p>* <strong>ID \u6216 UUID \u9519\u8bef<\/strong>\uff1a\u5bf9\u4e8e VLESS \u548c VMess \u534f\u8bae\uff0c\u5ba2\u6237\u7aef\u7684 UUID \u5fc5\u987b\u4e0e\u670d\u52a1\u5668\u7aef Inbound \u7528\u6237\u7684 UUID \u5b8c\u5168\u4e00\u81f4\u3002\u5373\u4f7f\u662f\u4e00\u4e2a\u5b57\u7b26\u7684\u5dee\u5f02\u4e5f\u4f1a\u5bfc\u81f4\u8ba4\u8bc1\u5931\u8d25\u3002<br \/>* <strong>\u52a0\u5bc6\u65b9\u5f0f\u9519\u8bef<\/strong>\uff1aVMess \u534f\u8bae\u9ed8\u8ba4\u4f7f\u7528 AES-128-GCM \u6216 CHACHA20-POLY1305\u3002\u5982\u679c\u5ba2\u6237\u7aef\u8bbe\u7f6e\u4e3a &#8220;none&#8221; \u800c\u670d\u52a1\u5668\u7aef\u8981\u6c42\u52a0\u5bc6\uff0c\u8fde\u63a5\u5c06\u5931\u8d25\u3002<br \/>* <strong>\u7248\u672c\u517c\u5bb9\u6027<\/strong>\uff1aXray \u6838\u5fc3\u5bf9\u534f\u8bae\u7248\u672c\u6709\u4e25\u683c\u8981\u6c42\u3002\u786e\u4fdd\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u534f\u8bae\u7248\u672c\uff08\u5982 VMess v11\uff09\u4e0e\u670d\u52a1\u5668\u7aef\u652f\u6301\u7684\u8303\u56f4\u5339\u914d\u3002<\/p>\n<h3>3. DNS \u89e3\u6790\u4e0e\u8def\u7531\u95ee\u9898<\/h3>\n<p>\u5373\u4f7f\u8fde\u63a5\u6210\u529f\uff0c\u5982\u679c\u65e0\u6cd5\u8bbf\u95ee\u76ee\u6807\u7f51\u7ad9\uff0c\u901a\u5e38\u662f DNS \u6216\u8def\u7531\u914d\u7f6e\u9519\u8bef\u3002<\/p>\n<p>* <strong>DNS \u6c61\u67d3<\/strong>\uff1a\u5982\u679c\u672c\u5730 DNS \u88ab\u6c61\u67d3\uff0cXray \u7684 DNS \u6a21\u5757\u5fc5\u987b\u6b63\u786e\u914d\u7f6e\uff0c\u4f7f\u7528\u8fdc\u7a0b DNS\uff08\u5982 8.8.8.8, 1.1.1.1\uff09\u8fdb\u884c\u89e3\u6790\u3002<br \/>* <strong>\u8def\u7531\u89c4\u5219\u7f3a\u5931<\/strong>\uff1a\u5982\u679c\u672a\u914d\u7f6e\u8def\u7531\u89c4\u5219\uff0c\u6240\u6709\u6d41\u91cf\u53ef\u80fd\u9ed8\u8ba4\u8d70\u76f4\u8fde\uff0c\u5bfc\u81f4\u90e8\u5206\u7f51\u7ad9\u65e0\u6cd5\u8bbf\u95ee\u3002\u9700\u8981\u914d\u7f6e geoip \u548c geosite \u89c4\u5219\uff0c\u5c06\u7279\u5b9a\u57df\u540d\u6307\u5411\u4ee3\u7406\u51fa\u7ad9\u3002<\/p>\n<h2>\u914d\u7f6e\u6587\u4ef6\u7684\u68c0\u67e5\u4e0e\u9a8c\u8bc1\u6b65\u9aa4<\/h2>\n<p>\u5f53\u9047\u5230\u914d\u7f6e\u5931\u8d25\u65f6\uff0c\u6309\u7167\u4ee5\u4e0b\u6b65\u9aa4\u9010\u4e00\u68c0\u67e5\u914d\u7f6e\u6587\u4ef6\uff08config.json\uff09\u3002<\/p>\n<h3>\u7b2c\u4e00\u6b65\uff1a\u68c0\u67e5 JSON \u8bed\u6cd5<\/h3>\n<p>\u914d\u7f6e\u6587\u4ef6\u5fc5\u987b\u662f\u5408\u6cd5\u7684 JSON \u683c\u5f0f\u3002\u4efb\u4f55\u591a\u4f59\u7684\u9017\u53f7\u3001\u7f3a\u5931\u7684\u5927\u62ec\u53f7\u6216\u5f15\u53f7\u9519\u8bef\u90fd\u4f1a\u5bfc\u81f4 Xray \u65e0\u6cd5\u542f\u52a8\u3002<\/p>\n<p>* <strong>\u64cd\u4f5c<\/strong>\uff1a\u5c06\u914d\u7f6e\u6587\u4ef6\u5185\u5bb9\u590d\u5236\u5230\u5728\u7ebf JSON \u6821\u9a8c\u5de5\u5177\u4e2d\uff0c\u786e\u4fdd\u6ca1\u6709\u8bed\u6cd5\u9519\u8bef\u3002<br \/>* <strong>\u539f\u56e0<\/strong>\uff1aJSON \u89e3\u6790\u5668\u5bf9\u683c\u5f0f\u8981\u6c42\u4e25\u683c\uff0c\u5fae\u5c0f\u7684\u8bed\u6cd5\u9519\u8bef\u4f1a\u5bfc\u81f4\u6574\u4e2a\u914d\u7f6e\u5931\u6548\u3002<\/p>\n<h3>\u7b2c\u4e8c\u6b65\uff1a\u6838\u5bf9 Inbound \u4e0e Outbound \u53c2\u6570<\/h3>\n<p>* <strong>Inbound \u68c0\u67e5<\/strong>\uff1a<br \/> * `port`\uff1a\u76d1\u542c\u7aef\u53e3\u662f\u5426\u4e0e\u5ba2\u6237\u7aef\u914d\u7f6e\u4e00\u81f4\u3002<br \/> * `protocol`\uff1a\u534f\u8bae\u7c7b\u578b\u662f\u5426\u6b63\u786e\u3002<br \/> * `settings`\uff1a\u7528\u6237 ID\u3001\u52a0\u5bc6\u65b9\u5f0f\u3001\u6743\u9650\u8bbe\u7f6e\u662f\u5426\u6b63\u786e\u3002<br \/>* <strong>Outbound \u68c0\u67e5<\/strong>\uff1a<br \/> * `protocol`\uff1a\u51fa\u7ad9\u534f\u8bae\u662f\u5426\u6b63\u786e\uff08\u901a\u5e38\u4e3a socks \u6216 http\uff09\u3002<br \/> * `settings`\uff1a\u5982\u679c\u914d\u7f6e\u4e86\u591a\u8df3\uff0c\u786e\u4fdd\u4e0b\u4e00\u8df3\u7684 IP \u548c\u7aef\u53e3\u6b63\u786e\u3002<\/p>\n<h3>\u7b2c\u4e09\u6b65\uff1a\u9a8c\u8bc1 Transport \u914d\u7f6e<\/h3>\n<p>\u5982\u679c\u4f7f\u7528\u4e86\u975e TCP \u4f20\u8f93\u534f\u8bae\uff08\u5982 WebSocket, HTTP\/2, QUIC\uff09\uff0c\u5fc5\u987b\u786e\u4fdd Transport \u914d\u7f6e\u5b8c\u6574\u3002<\/p>\n<p>* <strong>WebSocket<\/strong>\uff1a\u68c0\u67e5 `path`\uff08\u8def\u5f84\uff09\u548c `headers`\uff08Host, User-Agent \u7b49\uff09\u662f\u5426\u4e0e\u670d\u52a1\u5668\u7aef\u914d\u7f6e\u4e00\u81f4\u3002<br \/>* <strong>HTTP\/2<\/strong>\uff1a\u68c0\u67e5 `host`\uff08\u57df\u540d\uff09\u548c `path` \u662f\u5426\u6b63\u786e\u3002<br \/>* <strong>QUIC<\/strong>\uff1a\u786e\u4fdd\u670d\u52a1\u5668\u548c\u5ba2\u6237\u7aef\u90fd\u652f\u6301 QUIC \u534f\u8bae\uff0c\u4e14\u7aef\u53e3\u5df2\u5f00\u653e\u3002<\/p>\n<h3>\u7b2c\u56db\u6b65\uff1a\u68c0\u67e5 DNS \u548c Routing \u914d\u7f6e<\/h3>\n<p>* <strong>DNS \u914d\u7f6e<\/strong>\uff1a\u786e\u4fdd `dns` \u5b57\u6bb5\u4e2d\u914d\u7f6e\u4e86\u53ef\u9760\u7684 DNS \u670d\u52a1\u5668\uff0c\u5e76\u4e14 `servers` \u5217\u8868\u4e2d\u5305\u542b\u8fd9\u4e9b\u670d\u52a1\u5668\u3002<br \/>* <strong>Routing \u914d\u7f6e<\/strong>\uff1a\u68c0\u67e5 `routing` \u5b57\u6bb5\u4e2d\u7684 `rules`\uff0c\u786e\u4fdd\u57df\u540d\u89c4\u5219\uff08geosite\uff09\u548c IP \u89c4\u5219\uff08geoip\uff09\u6b63\u786e\u52a0\u8f7d\uff0c\u5e76\u4e14\u7b56\u7565\uff08strategy\uff09\u8bbe\u7f6e\u4e3a &#8220;ipcidr&#8221; \u6216 &#8220;domain&#8221;\u3002<\/p>\n<h2>\u65e5\u5fd7\u5206\u6790\u4e0e\u6545\u969c\u5b9a\u4f4d<\/h2>\n<p>Xray \u7684\u65e5\u5fd7\u662f\u6392\u67e5\u6545\u969c\u7684\u5173\u952e\u3002\u901a\u8fc7\u67e5\u770b\u65e5\u5fd7\uff0c\u53ef\u4ee5\u5feb\u901f\u5b9a\u4f4d\u95ee\u9898\u6240\u5728\u3002<\/p>\n<h3>\u67e5\u770b\u65e5\u5fd7\u7684\u65b9\u6cd5<\/h3>\n<p>* <strong>\u547d\u4ee4\u884c\u542f\u52a8<\/strong>\uff1a\u4f7f\u7528 `xray run -c config.json` \u542f\u52a8\uff0c\u65e5\u5fd7\u4f1a\u76f4\u63a5\u8f93\u51fa\u5230\u7ec8\u7aef\u3002<br \/>* <strong>\u670d\u52a1\u542f\u52a8<\/strong>\uff1a\u5982\u679c\u4f7f\u7528 systemd \u6216\u5176\u4ed6\u670d\u52a1\u7ba1\u7406\u5668\uff0c\u67e5\u770b `\/var\/log\/syslog` \u6216 `journalctl -u xray`\u3002<\/p>\n<h3>\u5e38\u89c1\u65e5\u5fd7\u9519\u8bef\u89e3\u8bfb<\/h3>\n<p><\/p>\n<table style=\"width:100%;border-collapse:collapse;margin:24px 0;\">\n<thead>\n<tr>\n<th style=\"border:1px solid #ddd;padding:10px;background:#f7f7f7;text-align:left;\">\u65e5\u5fd7\u4fe1\u606f<\/th>\n<th style=\"border:1px solid #ddd;padding:10px;background:#f7f7f7;text-align:left;\">\u542b\u4e49<\/th>\n<th style=\"border:1px solid #ddd;padding:10px;background:#f7f7f7;text-align:left;\">\u89e3\u51b3\u65b9\u6848<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">`failed to handle connection`<\/td>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">\u8fde\u63a5\u5904\u7406\u5931\u8d25<\/td>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">\u68c0\u67e5\u534f\u8bae\u548c\u7aef\u53e3\u5339\u914d<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">`invalid request`<\/td>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">\u8bf7\u6c42\u65e0\u6548<\/td>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">\u68c0\u67e5 UUID\u3001\u52a0\u5bc6\u65b9\u5f0f\u3001\u534f\u8bae\u7248\u672c<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">`dns lookup failed`<\/td>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">DNS \u89e3\u6790\u5931\u8d25<\/td>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">\u68c0\u67e5 DNS \u914d\u7f6e\u548c\u7f51\u7edc\u8fde\u901a\u6027<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">`transport closed`<\/td>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">\u4f20\u8f93\u901a\u9053\u5173\u95ed<\/td>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">\u68c0\u67e5\u7f51\u7edc\u7a33\u5b9a\u6027\u3001\u9632\u706b\u5899\u62e6\u622a<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">`certificate error`<\/td>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">\u8bc1\u4e66\u9519\u8bef<\/td>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">\u68c0\u67e5\u8bc1\u4e66\u8def\u5f84\u3001\u6709\u6548\u671f\u3001SAN \u57df\u540d<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><\/p>\n<h3>\u542f\u7528\u8be6\u7ec6\u65e5\u5fd7<\/h3>\n<p>\u5982\u679c\u9ed8\u8ba4\u65e5\u5fd7\u4fe1\u606f\u4e0d\u8db3\uff0c\u53ef\u4ee5\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u542f\u7528\u8be6\u7ec6\u65e5\u5fd7\uff1a<\/p>\n<p>&#8220;`json<br \/>&#8220;log&#8221;: {<br \/> &#8220;loglevel&#8221;: &#8220;debug&#8221;<br \/>}<br \/>&#8220;`<\/p>\n<p>\u8c03\u8bd5\u65e5\u5fd7\u4f1a\u8f93\u51fa\u66f4\u8be6\u7ec6\u7684\u63e1\u624b\u8fc7\u7a0b\u548c\u9519\u8bef\u4fe1\u606f\uff0c\u6709\u52a9\u4e8e\u5b9a\u4f4d\u6df1\u5c42\u6b21\u95ee\u9898\u3002\u4f46\u8bf7\u6ce8\u610f\uff0c\u8c03\u8bd5\u65e5\u5fd7\u4f1a\u6d88\u8017\u66f4\u591a\u8d44\u6e90\uff0c\u5efa\u8bae\u5728\u6392\u67e5\u5b8c\u6210\u540e\u5173\u95ed\u3002<\/p>\n<h2>\u7f51\u7edc\u73af\u5883\u4e0e\u9632\u706b\u5899\u7684\u5f71\u54cd<\/h2>\n<p>\u5373\u4f7f\u914d\u7f6e\u5b8c\u5168\u6b63\u786e\uff0c\u7f51\u7edc\u73af\u5883\u4e5f\u53ef\u80fd\u5bfc\u81f4\u914d\u7f6e\u5931\u8d25\u3002<\/p>\n<h3>\u9632\u706b\u5899\u4e0e\u7aef\u53e3\u5c01\u9501<\/h3>\n<p>* <strong>\u4e91\u670d\u52a1\u5668\u5b89\u5168\u7ec4<\/strong>\uff1a\u786e\u4fdd\u4e91\u670d\u52a1\u5546\uff08\u5982\u963f\u91cc\u4e91\u3001\u817e\u8baf\u4e91\u3001AWS\uff09\u7684\u5b89\u5168\u7ec4\u89c4\u5219\u5df2\u653e\u884c\u5165\u7ad9\u7aef\u53e3\u3002<br \/>* <strong>\u672c\u5730\u9632\u706b\u5899<\/strong>\uff1a\u68c0\u67e5\u64cd\u4f5c\u7cfb\u7edf\u9632\u706b\u5899\uff08\u5982 Windows Defender \u9632\u706b\u5899\u3001UFW\uff09\u662f\u5426\u963b\u6b62\u4e86 Xray \u7684\u7aef\u53e3\u3002<br \/>* <strong>ISP \u5c01\u9501<\/strong>\uff1a\u67d0\u4e9b\u7f51\u7edc\u73af\u5883\u4f1a\u5c01\u9501\u5e38\u89c1\u4ee3\u7406\u7aef\u53e3\uff08\u5982 443, 80, 8080\uff09\u3002\u5c1d\u8bd5\u4f7f\u7528 8443\u30012053 \u7b49\u975e\u5e38\u89c4\u7aef\u53e3\uff0c\u6216\u4f7f\u7528\u7aef\u53e3\u6df7\u6dc6\u6280\u672f\u3002<\/p>\n<h3>MTU \u8bbe\u7f6e\u95ee\u9898<\/h3>\n<p>\u5728\u67d0\u4e9b\u7f51\u7edc\u73af\u5883\u4e0b\uff0cMTU\uff08\u6700\u5927\u4f20\u8f93\u5355\u5143\uff09\u8bbe\u7f6e\u4e0d\u5f53\u4f1a\u5bfc\u81f4\u6570\u636e\u5305\u5206\u7247\uff0c\u8fdb\u800c\u5f15\u8d77\u8fde\u63a5\u4e0d\u7a33\u5b9a\u6216\u8d85\u65f6\u3002<\/p>\n<p>* <strong>\u68c0\u67e5 MTU<\/strong>\uff1a\u4f7f\u7528 `ping -f -l <size> <gateway>` \u6d4b\u8bd5 MTU \u503c\u3002<br \/>* <strong>\u8c03\u6574 MTU<\/strong>\uff1a\u5728\u5ba2\u6237\u7aef\u6216\u670d\u52a1\u5668\u7aef\u8c03\u6574 MTU \u503c\uff0c\u901a\u5e38\u8bbe\u7f6e\u4e3a 1400 \u6216 1460 \u53ef\u4ee5\u63d0\u9ad8\u7a33\u5b9a\u6027\u3002<\/p>\n<h2>\u5ba2\u6237\u7aef\u914d\u7f6e\u540c\u6b65\u4e0e\u8c03\u8bd5<\/h2>\n<p>\u5ba2\u6237\u7aef\u914d\u7f6e\u5fc5\u987b\u4e0e\u670d\u52a1\u5668\u7aef\u914d\u7f6e\u4e25\u683c\u540c\u6b65\u3002\u4ee5\u4e0b\u662f\u5ba2\u6237\u7aef\u914d\u7f6e\u7684\u5e38\u89c1\u9519\u8bef\u3002<\/p>\n<h3>\u534f\u8bae\u9009\u62e9<\/h3>\n<p>\u786e\u4fdd\u5ba2\u6237\u7aef\u9009\u62e9\u7684\u534f\u8bae\uff08\u5982 VLESS, VMess, Trojan\uff09\u4e0e\u670d\u52a1\u5668\u7aef Inbound \u534f\u8bae\u4e00\u81f4\u3002<\/p>\n<h3>\u670d\u52a1\u5668\u5730\u5740\u4e0e\u7aef\u53e3<\/h3>\n<p>\u68c0\u67e5\u670d\u52a1\u5668 IP \u6216\u57df\u540d\u662f\u5426\u6b63\u786e\uff0c\u7aef\u53e3\u662f\u5426\u4e0e\u670d\u52a1\u5668\u7aef\u76d1\u542c\u7aef\u53e3\u4e00\u81f4\u3002<\/p>\n<h3>UUID \u4e0e ID<\/h3>\n<p>\u5bf9\u4e8e VLESS \u548c VMess\uff0cUUID \u5fc5\u987b\u5b8c\u5168\u4e00\u81f4\u3002\u590d\u5236\u65f6\u907f\u514d\u591a\u4f59\u7a7a\u683c\u6216\u6362\u884c\u3002<\/p>\n<h3>\u4f20\u8f93\u534f\u8bae\u4e0e\u4f2a\u88c5<\/h3>\n<p>\u5982\u679c\u670d\u52a1\u5668\u7aef\u4f7f\u7528 WebSocket\uff0c\u5ba2\u6237\u7aef\u5fc5\u987b\u914d\u7f6e\u76f8\u540c\u7684 path \u548c Host\u3002\u5982\u679c\u670d\u52a1\u5668\u7aef\u4f7f\u7528 HTTP\/2\uff0c\u5ba2\u6237\u7aef\u5fc5\u987b\u914d\u7f6e\u76f8\u540c\u7684 host \u548c path\u3002<\/p>\n<h3>TLS \u914d\u7f6e<\/h3>\n<p>\u5982\u679c\u670d\u52a1\u5668\u7aef\u542f\u7528 TLS\uff0c\u5ba2\u6237\u7aef\u5fc5\u987b\u542f\u7528 TLS\uff0c\u5e76\u786e\u4fdd\u8bc1\u4e66\u9a8c\u8bc1\u6b63\u786e\u3002\u5982\u679c\u670d\u52a1\u5668\u7aef\u4f7f\u7528\u81ea\u7b7e\u540d\u8bc1\u4e66\uff0c\u5ba2\u6237\u7aef\u53ef\u80fd\u9700\u8981\u7981\u7528\u8bc1\u4e66\u9a8c\u8bc1\uff08\u4e0d\u63a8\u8350\uff0c\u4ec5\u7528\u4e8e\u6d4b\u8bd5\uff09\u3002<\/p>\n<h2>\u907f\u514d\u914d\u7f6e\u5931\u8d25\u7684\u5b9e\u7528\u5efa\u8bae<\/h2>\n<p>\u4e3a\u4e86\u51cf\u5c11\u914d\u7f6e\u5931\u8d25\u7684\u6982\u7387\uff0c\u5efa\u8bae\u9075\u5faa\u4ee5\u4e0b\u6700\u4f73\u5b9e\u8df5\u3002<br \/>\u2022 <strong>\u4f7f\u7528\u5b98\u65b9\u6587\u6863<\/strong>\uff1a\u59cb\u7ec8\u53c2\u8003 Xray \u5b98\u65b9\u6587\u6863\uff0c\u786e\u4fdd\u914d\u7f6e\u53c2\u6570\u6b63\u786e\u3002<br \/>\u2022 <strong>\u6700\u5c0f\u5316\u914d\u7f6e<\/strong>\uff1a\u5148\u4ece\u6700\u7b80\u5355\u7684\u914d\u7f6e\u5f00\u59cb\uff08\u5982 TCP + VMess\uff09\uff0c\u9010\u6b65\u6dfb\u52a0\u590d\u6742\u529f\u80fd\uff08\u5982 TLS\u3001WebSocket\uff09\u3002<br \/>\u2022 <strong>\u5907\u4efd\u914d\u7f6e\u6587\u4ef6<\/strong>\uff1a\u5728\u4fee\u6539\u914d\u7f6e\u524d\uff0c\u5907\u4efd\u539f\u59cb\u914d\u7f6e\u6587\u4ef6\uff0c\u4ee5\u4fbf\u5feb\u901f\u56de\u6eda\u3002<br \/>\u2022 <strong>\u4f7f\u7528\u914d\u7f6e\u751f\u6210\u5668<\/strong>\uff1a\u4f7f\u7528\u53ef\u9760\u7684\u914d\u7f6e\u751f\u6210\u5de5\u5177\uff0c\u907f\u514d\u624b\u52a8\u8f93\u5165\u9519\u8bef\u3002<br \/>\u2022 <strong>\u5b9a\u671f\u68c0\u67e5\u8bc1\u4e66<\/strong>\uff1a\u786e\u4fdd\u8bc1\u4e66\u672a\u8fc7\u671f\uff0c\u4e14\u57df\u540d\u5339\u914d\u3002<br \/>\u2022 <strong>\u76d1\u63a7\u65e5\u5fd7<\/strong>\uff1a\u5b9a\u671f\u67e5\u770b\u65e5\u5fd7\uff0c\u53ca\u65f6\u53d1\u73b0\u5e76\u89e3\u51b3\u6f5c\u5728\u95ee\u9898\u3002<\/p>\n<h2>\u603b\u7ed3<\/h2>\n<p>Xray \u914d\u7f6e\u5931\u8d25\u901a\u5e38\u6e90\u4e8e\u53c2\u6570\u4e0d\u5339\u914d\u3001\u7f51\u7edc\u73af\u5883\u9650\u5236\u6216 DNS \u8def\u7531\u9519\u8bef\u3002\u901a\u8fc7\u7cfb\u7edf\u6027\u5730\u68c0\u67e5 JSON \u8bed\u6cd5\u3001Inbound\/Outbound \u53c2\u6570\u3001Transport \u914d\u7f6e\u3001DNS \u548c Routing \u8bbe\u7f6e\uff0c\u4ee5\u53ca\u5206\u6790\u65e5\u5fd7\u4fe1\u606f\uff0c\u53ef\u4ee5\u5feb\u901f\u5b9a\u4f4d\u5e76\u89e3\u51b3\u95ee\u9898\u3002\u7406\u89e3 Xray \u7684\u6838\u5fc3\u529f\u80fd\u6a21\u5757\u53ca\u5176\u4ea4\u4e92\u903b\u8f91\uff0c\u662f\u914d\u7f6e\u6210\u529f\u7684\u5173\u952e\u3002\u540c\u65f6\uff0c\u6ce8\u610f\u7f51\u7edc\u73af\u5883\u548c\u9632\u706b\u5899\u7684\u5f71\u54cd\uff0c\u786e\u4fdd\u7aef\u53e3\u5f00\u653e\u548c\u7f51\u7edc\u8fde\u901a\u6027\uff0c\u662f\u914d\u7f6e\u7a33\u5b9a\u7684\u57fa\u7840\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5f53\u4f60\u5728\u914d\u7f6e Xray \u65f6\u9047\u5230\u8fde\u63a5\u5931\u8d25\u3001\u534f\u8bae\u62a5\u9519\u6216\u65e0\u6cd5\u89e3\u6790\u57df\u540d\u7b49\u95ee\u9898\uff0c\u901a\u5e38\u4e0d\u662f\u6838\u5fc3\u4ee3\u7801\u672c\u8eab\u7684\u7f3a\u9677\uff0c\u800c\u662f\u5ba2\u6237\u7aef\u914d\u7f6e [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1429","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.suannai.link\/blog\/wp-json\/wp\/v2\/posts\/1429","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.suannai.link\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.suannai.link\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.suannai.link\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.suannai.link\/blog\/wp-json\/wp\/v2\/comments?post=1429"}],"version-history":[{"count":0,"href":"https:\/\/www.suannai.link\/blog\/wp-json\/wp\/v2\/posts\/1429\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.suannai.link\/blog\/wp-json\/wp\/v2\/media?parent=1429"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.suannai.link\/blog\/wp-json\/wp\/v2\/categories?post=1429"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.suannai.link\/blog\/wp-json\/wp\/v2\/tags?post=1429"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}