Skip to content

panic: Calling Domain() on an IPv4Address. | /common/net/address.go:140 #4944

Closed

Description

@xqzr

Windows

echo {"inbounds":[{"port":"0,0-0","protocol":"mixed"}]}|xray
Xray 25.7.26 (Xray, Penetrates Everything.) b6b51c5 (go1.24.5 windows/amd64)
A unified platform for anti-censorship.
2025/07/26 17:39:49.298233 Using config from STDIN
2025/07/26 17:39:49.311552 [Info] infra/conf/serial: Reading config: &{Name:stdin: Format:json}
panic: Calling Domain() on an IPv4Address.

goroutine 1 [running]:
github.com/xtls/xray-core/common/net.ipv4Address.Domain(...)
        github.com/xtls/xray-core/common/net/address.go:140
github.com/xtls/xray-core/transport/internet/tcp.ListenTCP({0x12b6f40, 0x1cd30c0}, {0x12b7448, 0xc00000b294}, 0x0, 0xc0003a82a0, 0xc00028b8d0)
        github.com/xtls/xray-core/transport/internet/tcp/hub.go:46 +0x172
github.com/xtls/xray-core/transport/internet.ListenTCP({0x12b6f40, 0x1cd30c0}, {0x12b7448, 0xc00000b294}, 0x0, 0xc0003a8240?, 0xc00028b8d0)
        github.com/xtls/xray-core/transport/internet/tcp_hub.go:74 +0x255
github.com/xtls/xray-core/app/proxyman/inbound.(*tcpWorker).Start(0xc000397860)
        github.com/xtls/xray-core/app/proxyman/inbound/worker.go:122 +0x76
github.com/xtls/xray-core/app/proxyman/inbound.(*AlwaysOnInboundHandler).Start(0x0?)
        github.com/xtls/xray-core/app/proxyman/inbound/always.go:161 +0x45
github.com/xtls/xray-core/app/proxyman/inbound.(*Manager).Start(0xc0002a7c80)
        github.com/xtls/xray-core/app/proxyman/inbound/inbound.go:121 +0x146
github.com/xtls/xray-core/core.(*Instance).Start(0xc0002c0cb0)
        github.com/xtls/xray-core/core/xray.go:390 +0xd2
main.executeRun(0x1c74d20?, {0xc00028e630?, 0x1c8ac80?, 0x70000000028e620?})
        github.com/xtls/xray-core/main/run.go:90 +0x149
github.com/xtls/xray-core/main/commands/base.Execute()
        github.com/xtls/xray-core/main/commands/base/execute.go:64 +0x5ab
main.main()
        github.com/xtls/xray-core/main/main.go:22 +0x1a5

config.json

{
 "inbounds": [
  {
   "port": "0,0-0",
   "protocol": "mixed"
  }
 ]
}

Activity

  1. RPRX commented on Jul 26, 2025

    @RPRX
    Member

    这配置是啥玩意儿啊?listen 呢?

    能不能不要每次在新版本后搞这种奇葩测试,要搞就一次性搞完

  2. RPRX commented on Jul 26, 2025

    @RPRX
    Member

    看了下代码,你这是因为配置了 port 0,被当成 UDS 处理了,非 bug,非 port 0 没问题

  3. RPRX commented on Jul 26, 2025

    @RPRX
    Member

    @xqzr 有异议吗

  4. xqzr commented on Jul 26, 2025

    @xqzr
    ContributorAuthor

    panic 就是问题,何况是用户输入导致的 panic

  5. RPRX commented on Jul 26, 2025

    @RPRX
    Member

    错误的配置导致 panic 符合预期,想改为抛出 error 的话可以开 PR

  6. xqzr commented on Jul 26, 2025

    @xqzr
    ContributorAuthor

    这配置是啥玩意儿啊?listen 呢?

    listen 非必选。默认 0.0.0.0

  7. RPRX commented on Jul 26, 2025

    @RPRX
    Member

    这配置是啥玩意儿啊?listen 呢?

    listen 非必选。默认 0.0.0.0

    我知道,文档看到了

  8. Fangliding commented on Jul 26, 2025

    @Fangliding
    Member

    改吧改吧 写个if而已

  9. xqzr commented on Jul 26, 2025

    @xqzr
    ContributorAuthor

    我认为:应该添加判断,从而避免 panic

  10. reopened this on Aug 3, 2025
  11. bytecategory commented on Aug 15, 2026

    @bytecategory
    Contributor

    错误的配置导致 panic 符合预期,想改为抛出 error 的话可以开 PR

    ?

  12. bytecategory commented on Aug 15, 2026

    @bytecategory
    Contributor

    仅仅用于记录这个版本已经修复.

    echo {"inbounds":[{"port":"0,0-0","protocol":"mixed"}]}|xray
    Xray 26.3.27 (Xray, Penetrates Everything.) d2758a0 (go1.26.1 windows/amd64)
    A unified platform for anti-censorship.
    2026/08/15 17:27:29.835341 Using config from STDIN
    2026/08/15 17:27:29.845773 [Info] infra/conf/serial: Reading config: &{Name:stdin: Format:json}
    Failed to start: app/proxyman/inbound: failed to listen TCP on 0 > transport/internet: failed to listen on address: 0.0.0.0:0 > transport/internet/tcp: invalid unix listen: 0.0.0.0
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions