[GH-ISSUE #1395] xray无法运行 #941

Closed
opened 2026-10-31 20:15:29 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @bian2022 on GitHub (Dec 16, 2023).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/1395

xui报错
2023/12/16 15:12:36 WARNING - X-UI: get xray traffic failed:rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing: dial tcp 127.0.0.1:20099: connect: connection refused"

xray配置文件
"inbounds": [
{
"tag": "api",
"listen": "127.0.0.1",
"port": 20099,
"protocol": "dokodemo-door",
"settings": {
"address": "127.0.0.1"
}
}
],

有什么解决办法吗?

Originally created by @bian2022 on GitHub (Dec 16, 2023). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/1395 xui报错 2023/12/16 15:12:36 WARNING - X-UI: get xray traffic failed:rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing: dial tcp 127.0.0.1:20099: connect: connection refused" xray配置文件 "inbounds": [ { "tag": "api", "listen": "127.0.0.1", "port": 20099, "protocol": "dokodemo-door", "settings": { "address": "127.0.0.1" } } ], 有什么解决办法吗?
bsakaguchi 2026-10-31 20:15:29 +07:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@pulsarice commented on GitHub (Dec 16, 2023):

Make sure you have all of these parts in your xray config:

{
  "api": {
    "tag": "api",
    "services": [
      "HandlerService",
      "LoggerService",
      "StatsService"
    ]
  },
  "inbounds": [
    {
      "tag": "api",
      "listen": "127.0.0.1",
      "port": 62789,
      "protocol": "dokodemo-door",
      "settings": {
        "address": "127.0.0.1"
      }
    }
  ],
  "policy": {
    "levels": {
      "0": {
        "statsUserDownlink": true,
        "statsUserUplink": true
      }
    },
    "system": {
      "statsInboundDownlink": true,
      "statsInboundUplink": true
    }
  },
  "routing": {
    "rules": [
      {
        "type": "field",
        "inboundTag": [
          "api"
        ],
        "outboundTag": "api"
      },
  "stats": {}
}
<!-- gh-comment-id:1858923054 --> @pulsarice commented on GitHub (Dec 16, 2023): Make sure you have all of these parts in your xray config: ``` { "api": { "tag": "api", "services": [ "HandlerService", "LoggerService", "StatsService" ] }, "inbounds": [ { "tag": "api", "listen": "127.0.0.1", "port": 62789, "protocol": "dokodemo-door", "settings": { "address": "127.0.0.1" } } ], "policy": { "levels": { "0": { "statsUserDownlink": true, "statsUserUplink": true } }, "system": { "statsInboundDownlink": true, "statsInboundUplink": true } }, "routing": { "rules": [ { "type": "field", "inboundTag": [ "api" ], "outboundTag": "api" }, "stats": {} } ```
Author
Owner

@roman1gan commented on GitHub (Feb 17, 2024):

The inbound api must be first in the list of routing rules

<!-- gh-comment-id:1950308968 --> @roman1gan commented on GitHub (Feb 17, 2024): The inbound api must be first in the list of routing rules
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MHSanaei/3x-ui#941
No description provided.