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

v4配置文档"domain"项问题 #445

Open
dbox233 opened this issue Apr 3, 2024 · 1 comment · May be fixed by #447
Open

v4配置文档"domain"项问题 #445

dbox233 opened this issue Apr 3, 2024 · 1 comment · May be fixed by #447

Comments

@dbox233
Copy link

dbox233 commented Apr 3, 2024

{ "routing": { "rules":[ {"domain": []} <---- 这个配置项 ] } }
v2fly.org上的v4配置文档使用"domains",但v4 Releases内置默认的config.json却使用"domain",究竟哪一个才正确还是两个都正确?

@NessajCN
Copy link

NessajCN commented Apr 17, 2024

我今天也碰到这个疑问,过来一看居然十几天前有人问到,就去翻了下源码

master 分支

	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"`
	}

v4 分支

	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"`
	}

所以大概 v4 版本 domaindomains 都是对的,你甚至可以两个一起用
而最新版只有 domain 是对的

@NessajCN NessajCN linked a pull request Apr 17, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

2 participants