{"id":47,"date":"2024-03-05T14:02:54","date_gmt":"2024-03-05T06:02:54","guid":{"rendered":"https:\/\/jjm6.com\/?p=47"},"modified":"2024-03-05T14:02:54","modified_gmt":"2024-03-05T06:02:54","slug":"x-ui%e9%9d%a2%e6%9d%bf%e5%ae%9e%e7%8e%b0%e5%a4%9aip%e5%88%86%e6%b5%81%e5%87%ba%e7%ab%99","status":"publish","type":"post","link":"https:\/\/jjm6.com\/index.php\/2024\/03\/05\/x-ui%e9%9d%a2%e6%9d%bf%e5%ae%9e%e7%8e%b0%e5%a4%9aip%e5%88%86%e6%b5%81%e5%87%ba%e7%ab%99\/","title":{"rendered":"x-ui\u9762\u677f\u5b9e\u73b0\u591aip\u5206\u6d41\u51fa\u7ad9<a><\/a>"},"content":{"rendered":"\n<ul>\n<li>xui\u662f\u6700\u7b80\u5355\u7684\u9762\u677f\uff0c\u4f30\u8ba1\u6ca1\u6709\u4e4b\u4e00<br>\u901a\u8fc7xui\u5b9e\u73b0\u591aip\u5206\u6d41\u4e5f\u5f88\u7b80\u5355<br>\u521b\u5efa\u597d\u5165\u7ad9\u540e\u76f4\u63a5\u4fee\u6539\u9762\u677f\u8bbe\u7f6e\u91cc\u7684xray\u914d\u7f6e\u6a21\u677f\u5c31\u53ef\u4ee5\u4e86<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n  \"api\": {\n    \"services\": &#91;\n      \"HandlerService\",\n      \"LoggerService\",\n      \"StatsService\"\n    ],\n    \"tag\": \"api\"\n  },\n  \"inbounds\": &#91;\n    {\n      \"listen\": \"127.0.0.1\",\n      \"port\": 62789,\n      \"protocol\": \"dokodemo-door\",\n      \"settings\": {\n        \"address\": \"127.0.0.1\"\n      },\n      \"tag\": \"api\"\n    }\n  ],\n\n  \"outbounds\": &#91;\n   {\n      \"tag\": \"ip1\",\n      \"sendThrough\": \"1.1.1.1\",\n      \"protocol\": \"freedom\",\n      \"settings\": {}\n    },\n    {\n      \"tag\": \"ip2\",\n      \"sendThrough\": \"1.1.1.2\",\n      \"protocol\": \"freedom\",\n      \"settings\": {}\n    },\n    {\n      \"protocol\": \"freedom\",\n      \"settings\": {}\n    },\n    {\n      \"protocol\": \"blackhole\",\n      \"settings\": {},\n      \"tag\": \"blocked\"\n    }\n  ],\n  \"policy\": {\n    \"system\": {\n      \"statsInboundDownlink\": true,\n      \"statsInboundUplink\": true\n    }\n  },\n\n  \"routing\": {\n    \"rules\": &#91;\n   {\n        \"inboundTag\": &#91;\n          \"inbound-xxxxx\",\"inbound-xxxxx\"\n        ],\n        \"outboundTag\": \"ip1\",\n        \"type\": \"field\"\n      },\n      {\n        \"inboundTag\": &#91;\n          \"inbound-xxxxx\",\"inbound-xxxxx\"\n        ],\n        \"outboundTag\": \"ip2\",\n        \"type\": \"field\"\n      },\n      {\n        \"inboundTag\": &#91;\n          \"api\"\n        ],\n        \"outboundTag\": \"api\",\n        \"type\": \"field\"\n      },\n      {\n        \"ip\": &#91;\n          \"geoip:private\"\n        ],\n        \"outboundTag\": \"blocked\",\n        \"type\": \"field\"\n      },\n      {\n        \"outboundTag\": \"blocked\",\n        \"protocol\": &#91;\n          \"bittorrent\"\n        ],\n        \"type\": \"field\"\n      }\n    ]\n  },\n  \"stats\": {}\n}<\/code><\/pre>\n\n\n\n<p>xray\u7684\u901a\u4fe1\u539f\u7406\u662finbound-routing-outbound\uff0c\u4e5f\u5c31\u662f\u5165\u7ad9-\u8def\u7531\u89c4\u5219-\u51fa\u7ad9<br>\u5165\u7ad9\u8282\u70b9\u5185\u5bb9\u5b58\u653e\u5728\u6570\u636e\u5e93\u5185\uff0c\u4e0d\u5728\u6a21\u677f\u4e2d\uff0c\u6570\u636e\u5e93\u4e0e\u6a21\u677f\u5171\u540c\u7ec4\u5408\u6210config.json<br>\u8981\u5b9e\u73b0\u591aip\u5206\u6d41\uff0c\u4e3b\u8981\u662f\u901a\u8fc7\u4fee\u6539\u8def\u7531\u89c4\u5219\u5c06\u5165\u7ad9\u5217\u8868\u4e2d\u7684\u8282\u70b9\u4e0e\u4e0d\u540c\u7684\u51fa\u7ad9ip\u8fdb\u884c\u8fde\u63a5<br>\u6240\u4ee5\u7f16\u8f91routing\u548coutbound\u5373\u53ef\uff0c\u521b\u5efa\u597d\u8282\u70b9\u540einbound\u5185\u5bb9\u65e0\u9700\u4fee\u6539<\/p>\n\n\n\n<p><strong>outbound(\u51fa\u7ad9)\u89e3\u6790<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\"outbounds\": &#91;\n    {\n      \"tag\": \"ip1\",\n      \"sendThrough\": \"1.1.1.1\",\n      \"protocol\": \"freedom\",\n      \"settings\": {}\n    },\n    {\n      \"tag\": \"ip2\",\n      \"sendThrough\": \"1.1.1.2\",\n      \"protocol\": \"freedom\",\n      \"settings\": {}\n    },\n    ...........\n]<\/code><\/pre>\n\n\n\n<p>&#8220;tag&#8221;:\u5b9a\u4e49\u6b64\u51fa\u7ad9\u914d\u7f6e\u7684\u6807\u8bc6\uff0c\u5185\u5bb9\u968f\u610f\uff0c\u81ea\u5df1\u5206\u5f97\u6e05\u5c31\u884c<br>&#8220;sendThrough&#8221;:\u5b9a\u4e49\u51fa\u7ad9ip<br><strong>\u6709\u591a\u5c11\u4e2aip\u5c31\u6dfb\u52a0\u591a\u5c11\u4e2a{&#8230;.}\uff0c\u6ce8\u610f{&#8230;.}\u95f4\u7528\u82f1\u6587\u9017\u53f7\u9694\u5f00<\/strong><br><\/p>\n\n\n\n<p><strong>routing\uff08\u8def\u7531\u89c4\u5219\uff09\u89e3\u6790<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\"routing\": {\n    \"rules\": &#91;\n      {\n        \"inboundTag\": &#91;\n          \"inbound-xxxxx\",\"inbound-xxxxx\"\n        ],\n        \"outboundTag\": \"ip1\",\n        \"type\": \"field\"\n      },\n      {\n        \"inboundTag\": &#91;\n          \"inbound-xxxxx\",\"inbound-xxxxx\"\n        ],\n        \"outboundTag\": \"ip2\",\n        \"type\": \"field\"\n      },\n      ................\n]<\/code><\/pre>\n\n\n\n<ul>\n<li>&#8220;inboundTag&#8221;:\u5165\u7ad9\u914d\u7f6e\u7684\u6807\u8bc6\uff0c\u6bcf\u4e2a\u5165\u7ad9\u5217\u8868\u4e2d\u7684\u8282\u70b9\u90fd\u6709\u76f8\u5bf9\u5e94\u7684inboundTag<\/li>\n<\/ul>\n\n\n\n<p>xui\u5bf9inboundTag\u7684\u547d\u540d\u89c4\u5219\u662finbound-\u8282\u70b9\u7aef\u53e3\u53f7\uff0c\u6bd4\u65b9\u8bf4\u4e00\u4e2a\u8282\u70b9\u7684\u7aef\u53e3\u662f88888\uff0c\u90a3\u4e48\u8fd9\u4e2a\u8282\u70b9\u7684inboundTag\u5c31\u662finbound-88888<br>\u25c6  &#8220;outboundTag&#8221;:\u5bf9\u5e94\u51fa\u7ad9\u914d\u7f6e\u7684\u6807\u8bc6<br>\u8fd9\u4e2a\u8def\u7531\u89c4\u5219\u7684\u610f\u601d\u662f\u8bf4\uff0c\u5c06inboundtag-xxxxx\u6240\u5728\u7684inbound\u8282\u70b9\u4e0eoutbound ip\u8fde\u63a5\u3002\u8fd9\u6837\u5c31\u53ef\u4ee5\u5b9e\u73b0ip1\u901a\u8fc7ip1\u51fa\u7ad9\uff0cip2\u901a\u8fc7ip2\u51fa\u7ad9\uff0c\u6216\u8005ip1\u3001ip2\u901a\u8fc7ip1\u51fa\u7ad9\uff0cip3\u3001ip4\u901a\u8fc7ip2\u51fa\u7ad9\uff0c\u53ef\u4ee5\u968f\u610f\u7ec4\u5408<br>\u4e0d\u60f3\u4e86\u89e3\u90a3\u4e48\u591a\u4e5f\u53ef\u4ee5\uff0c\u76f4\u63a5\u5c06routing\u548coutbound\u91cc\u7684xx\u4fee\u6539\u597d\uff0c\u53c2\u7167\u4e0a\u9762\u6a21\u677f\u653e\u5728\u76f8\u5e94\u7684\u4f4d\u7f6e\uff0c\u91cd\u542f\u670d\u52a1\u5c31\u597d\u4e86<\/p>\n","protected":false},"excerpt":{"rendered":"<p>xray\u7684\u901a\u4fe1\u539f\u7406\u662finbound-routing-outbound\uff0c\u4e5f\u5c31\u662f\u5165\u7ad9-\u8def\u7531\u89c4\u5219-\u51fa\u7ad9\u5165\u7ad9\u8282\u70b9\u5185\u5bb9\u5b58 &hellip; <a href=\"https:\/\/jjm6.com\/index.php\/2024\/03\/05\/x-ui%e9%9d%a2%e6%9d%bf%e5%ae%9e%e7%8e%b0%e5%a4%9aip%e5%88%86%e6%b5%81%e5%87%ba%e7%ab%99\/\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">\u201cx-ui\u9762\u677f\u5b9e\u73b0\u591aip\u5206\u6d41\u51fa\u7ad9<a><\/a>\u201d<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[8],"_links":{"self":[{"href":"https:\/\/jjm6.com\/index.php\/wp-json\/wp\/v2\/posts\/47"}],"collection":[{"href":"https:\/\/jjm6.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jjm6.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jjm6.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jjm6.com\/index.php\/wp-json\/wp\/v2\/comments?post=47"}],"version-history":[{"count":1,"href":"https:\/\/jjm6.com\/index.php\/wp-json\/wp\/v2\/posts\/47\/revisions"}],"predecessor-version":[{"id":48,"href":"https:\/\/jjm6.com\/index.php\/wp-json\/wp\/v2\/posts\/47\/revisions\/48"}],"wp:attachment":[{"href":"https:\/\/jjm6.com\/index.php\/wp-json\/wp\/v2\/media?parent=47"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jjm6.com\/index.php\/wp-json\/wp\/v2\/categories?post=47"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jjm6.com\/index.php\/wp-json\/wp\/v2\/tags?post=47"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}