v2fly-github-io icon indicating copy to clipboard operation
v2fly-github-io copied to clipboard

fix incorrect RuleObject key `domains` to `domain`

Open NessajCN opened this issue 10 months ago • 0 comments

According to v2ray-core source master branch

type RawFieldRule struct {
	RouterRule
	Domain     *StringList  `json:"domain"`
	IP         *StringList  `json:"ip"`
	Port       *PortList    `json:"port"`
	Network    *NetworkList `json:"network"`
	SourceIP   *StringList  `json:"source"`
	SourcePort *PortList    `json:"sourcePort"`
	User       *StringList  `json:"user"`
	InboundTag *StringList  `json:"inboundTag"`
	Protocols  *StringList  `json:"protocol"`
	Attributes string       `json:"attrs"`
}

4.45.2 branch

type RawFieldRule struct {
	RouterRule
	Domain     *cfgcommon.StringList  `json:"domain"`
	Domains    *cfgcommon.StringList  `json:"domains"`
	IP         *cfgcommon.StringList  `json:"ip"`
	Port       *cfgcommon.PortList    `json:"port"`
	Network    *cfgcommon.NetworkList `json:"network"`
	SourceIP   *cfgcommon.StringList  `json:"source"`
	SourcePort *cfgcommon.PortList    `json:"sourcePort"`
	User       *cfgcommon.StringList  `json:"user"`
	InboundTag *cfgcommon.StringList  `json:"inboundTag"`
	Protocols  *cfgcommon.StringList  `json:"protocol"`
	Attributes string                 `json:"attrs"`
}

In master branch, RuleObject in RoutingObject has only domain key while both domains and domain key existed in 4.45.2 version.

However, the example of config.json in 4.45.2 release took domain key instead of domains that confuse some users like me. I suggest the doc consisting with release example.

This PR is created to fix this.

Related issue: fix #445

NessajCN avatar Apr 17 '24 02:04 NessajCN