v2fly / v2ray-core

A platform for building proxies to bypass network restrictions.
https://v2fly.org
MIT License
29.14k stars 4.61k forks source link

dns.Hostmapping in JSONv5 config treats ip as Base64 #2107

Closed yangbowen closed 1 year ago

yangbowen commented 1 year ago

What version of V2Ray are you using?

f9422d6

What's your scenario of using V2Ray?

Browsing via vmess+ws+tls proxy.

What problems have you encountered?

v2ray test -c config.json -format jsonv5 fails.

What's your expectation?

It should recognize the IP address in the config.

Please attach your configuration here

{
  "log": {
    "access": {
      "type": "None"
    },
    "error": {
      "type": "File",
      "path": "error.log",
      "level": "Warning"
    }
  },
  "dns": {
    "nameServer": [],
    "staticHosts": [
      {
        "type": "Subdomain",
        "domain": "cloudflare.com",
        "ip": [
          "1.1.1.1",
          "1.0.0.1"
        ]
      }
    ]
  },
  "inbounds": [],
  "outbounds": [],
  "router": {},
  "other": {}
}

(unrelated parts have been deleted since configuration parsing won't finish)

Please attach error logs here

Not relevant, since configuration parsing fails.

Please attach access log here

Not relevant, since configuration parsing fails.

Other configurations (such as Nginx) and logs here

Not relevant, since configuration parsing fails.

If V2Ray cannot start up, please attach output from --test command

v2ray test -c config.json -format jsonv5

V2Ray 5.1.0 (V2Fly, a community-driven edition of V2Ray.) Custom (go1.19.2 windows/amd64)
A unified platform for anti-censorship.
Test failed: main/commands: failed to load config: [config.json] > infra/conf/v5cfg: unable to build config > infra/conf/v5cfg: failed to parse DNS config > common/registry: unable to parse json content > illegal base64 data at input byte 1

If V2Ray service is abnormal, please attach journal log here

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 120 days with no activity. Remove stale label or comment or this will be closed in 5 days