Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用自定义route规则后无法启动,xrayr报错日志如下: #83

Closed
soundghost opened this issue Nov 7, 2022 · 5 comments
Closed

Comments

@soundghost
Copy link

config.yml 文件内容如下:

Log:
  Level: warning # Log level: none, error, warning, info, debug 
  AccessPath: # /etc/XrayR/access.Log
  ErrorPath: # /etc/XrayR/error.log
DnsConfigPath: /etc/XrayR/dns.json # Path to dns config, check https://xtls.github.io/config/dns.html for help
RouteConfigPath: /etc/XrayR/route.json # Path to route config, check https://xtls.github.io/config/routing.html for help
InboundConfigPath: # /etc/XrayR/custom_inbound.json # Path to custom inbound config, check https://xtls.github.io/config/inbound.html for help
OutboundConfigPath: /etc/XrayR/custom_outbound.json # Path to custom outbound config, check https://xtls.github.io/config/outbound.html for help
ConnetionConfig:
  Handshake: 4 # Handshake time limit, Second
  ConnIdle: 30 # Connection idle time limit, Second
  UplinkOnly: 1 # Time limit when the connection downstream is closed, Second
  DownlinkOnly: 2 # Time limit when the connection is closed after the uplink is closed, Second
  BufferSize: 64 # The internal cache size of each connection, kB 
Nodes:
  -
    PanelType: "V2board" # Panel type: SSpanel, V2board, PMpanel, Proxypanel, V2RaySocks
    ApiConfig:
      ApiHost: "https://website"
      ApiKey: "hashvalue"
      NodeID: 1
      NodeType: V2ray # Node type: V2ray, Shadowsocks, Trojan, Shadowsocks-Plugin
      Timeout: 30 # Timeout for the api request
      EnableVless: false # Enable Vless for V2ray Type
      EnableXTLS: false # Enable XTLS for V2ray and Trojan
      SpeedLimit: 0 # Mbps, Local settings will replace remote settings, 0 means disable
      DeviceLimit: 0 # Local settings will replace remote settings, 0 means disable
      RuleListPath: # /etc/XrayR/rulelist Path to local rulelist file
    ControllerConfig:
      ListenIP: 0.0.0.0 # IP address you want to listen
      SendIP: 0.0.0.0 # IP address you want to send pacakage
      UpdatePeriodic: 60 # Time to update the nodeinfo, how many sec.
      EnableDNS: true # Use custom DNS config, Please ensure that you set the dns.json well
      DNSType: AsIs # AsIs, UseIP, UseIPv4, UseIPv6, DNS strategy
      EnableProxyProtocol: false # Only works for WebSocket and TCP
      EnableFallback: false # Only support for Trojan and Vless
      AutoSpeedLimitConfig:
        Limit: 0 # Warned speed. Set to 0 to disable AutoSpeedLimit (mbps)
        WarnTimes: 0 # After (WarnTimes) consecutive warnings, the user will be limited. Set to 0 to punish overspeed user immediately.
        LimitSpeed: 0 # The speedlimit of a limited user (unit: mbps)
        LimitDuration: 0 # How many minutes will the limiting last (unit: minute)
      FallBackConfigs:  # Support multiple fallbacks
        -
          SNI: # TLS SNI(Server Name Indication), Empty for any
          Alpn: # Alpn, Empty for any
          Path: # HTTP PATH, Empty for any
          Dest: 80 # Required, Destination of fallback, check https://xtls.github.io/config/features/fallback.html for details.
          ProxyProtocolVer: 0 # Send PROXY protocol version, 0 for dsable
      CertConfig:
        CertMode: none # Option about how to get certificate: none, file, http, dns. Choose "none" will forcedly disable the tls config.
        CertDomain: "node1.test.com" # Domain to cert
        CertFile: /etc/XrayR/cert/node1.test.com.cert # Provided if the CertMode is file
        KeyFile: /etc/XrayR/cert/node1.test.com.key
        Provider: alidns # DNS cert provider, Get the full support list here: https://go-acme.github.io/lego/dns/
        Email: test@me.com
        DNSEnv: # DNS ENV option used by DNS provider
          ALICLOUD_ACCESS_KEY: aaa
          ALICLOUD_SECRET_KEY: bbb

重启Xrayx后报错如下:

Nov 07 20:32:13 BuyVM systemd[1]: XrayR.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Nov 07 20:32:13 BuyVM systemd[1]: XrayR.service: Failed with result 'exit-code'.
Nov 07 20:32:23 BuyVM systemd[1]: XrayR.service: Scheduled restart job, restart counter is at 5.
Nov 07 20:32:23 BuyVM systemd[1]: Stopped XrayR Service.
Nov 07 20:32:23 BuyVM systemd[1]: Started XrayR Service.
Nov 07 20:32:23 BuyVM XrayR[164752]: XrayR 0.8.5 (A Xray backend that supports many panels)
Nov 07 20:32:23 BuyVM XrayR[164752]: 2022/11/07 20:32:23 Start the panel..
Nov 07 20:32:24 BuyVM XrayR[164752]: 2022/11/07 20:32:24 failed to create instance: app/router: this rule has no effective fields
Nov 07 20:32:24 BuyVM XrayR[164752]: panic: failed to create instance: app/router: this rule has no effective fields
Nov 07 20:32:24 BuyVM XrayR[164752]: goroutine 1 [running]:
Nov 07 20:32:24 BuyVM XrayR[164752]: log.Panicf({0x2e971df?, 0xc0008e7740?}, {0xc000497bf8?, 0x2417700?, 0xc000d9e048?})
Nov 07 20:32:24 BuyVM XrayR[164752]:         log/log.go:395 +0x67
Nov 07 20:32:24 BuyVM XrayR[164752]: github.com/XrayR-project/XrayR/panel.(*Panel).loadCore(0xc0008d9e80?, 0xc000162af0)
Nov 07 20:32:24 BuyVM XrayR[164752]:         github.com/XrayR-project/XrayR/panel/panel.go:146 +0x9e5
Nov 07 20:32:24 BuyVM XrayR[164752]: github.com/XrayR-project/XrayR/panel.(*Panel).Start(0xc0008ebdc0)
Nov 07 20:32:24 BuyVM XrayR[164752]:         github.com/XrayR-project/XrayR/panel/panel.go:159 +0xe9
Nov 07 20:32:24 BuyVM XrayR[164752]: main.main()
Nov 07 20:32:24 BuyVM XrayR[164752]:         github.com/XrayR-project/XrayR/main/main.go:96 +0x250

请协助我解决,感谢!

@Septrum101
Copy link
Contributor

paste /etc/XrayR/route.json

@soundghost
Copy link
Author

paste /etc/XrayR/route.json

感谢回复,route.json内容如下:


{
    "domainStrategy": "IPIfNonMatch",
    "rules": [
        {
            "domain": [
                "geosite:cn"
            ],
            "outboundTag": "block",
            "type": "field"
        },
        {
            "ip": [
               "geoip:cn"
            ],
            "outboundTag": "block",
            "type": "field"
        },
        {
            "type": "field",
            "outboundTag": "block",
            "ip": [
                "geoip:private"
            ]
        },
        {
            "type": "field",
            "outboundTag": "block",
            "protocol": [
                "bittorrent"
            ]
        },
        {
            "type": "field",
            "outboundTag": "socks5-warp",
            "domain": []
        },
        {
            "type": "field",
            "outboundTag": "IPv6_out",
            "domain": [
                "geosite:netflix"
            ]
        },
        {
            "type": "field",
            "outboundTag": "IPv4_out",
            "network": "udp,tcp"
        }
    ]
}


Custom_outbound.json内容如下:


[
    {
        "tag": "IPv4_out",
        "protocol": "freedom",
        "settings": {}
    },
    {
        "tag": "IPv6_out",
        "protocol": "freedom",
        "settings": {
            "domainStrategy": "UseIPv6"
        }
    },
    {
        "tag": "socks5-warp",
        "protocol": "socks",
        "settings": {
            "servers": [{
                "address": "127.0.0.1",
                "port": 1080
            }]
        }
    },
    {
        "protocol": "blackhole",
        "tag": "block"
    }
]

@Septrum101
Copy link
Contributor

delete socks5-warp

@soundghost
Copy link
Author

delete socks5-warp

Thanks very much, it's working now.

@M1VPN
Copy link

M1VPN commented Feb 13, 2024

大佬,六啊,我也可以用了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants