mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-21 09:36:34 -05:00
Allow bulk definition of domain matcher at parent level
This commit is contained in:
parent
0043dd6685
commit
e22cf451f4
@ -41,6 +41,8 @@ type RouterConfig struct {
|
||||
RuleList []json.RawMessage `json:"rules"`
|
||||
DomainStrategy *string `json:"domainStrategy"`
|
||||
Balancers []*BalancingRule `json:"balancers"`
|
||||
|
||||
DomainMatcher string `json:"domainMatcher"`
|
||||
}
|
||||
|
||||
func (c *RouterConfig) getDomainStrategy() router.Config_DomainStrategy {
|
||||
@ -81,6 +83,11 @@ func (c *RouterConfig) Build() (*router.Config, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if rule.DomainMatcher == "" {
|
||||
rule.DomainMatcher = c.DomainMatcher
|
||||
}
|
||||
|
||||
config.Rule = append(config.Rule, rule)
|
||||
}
|
||||
for _, rawBalancer := range c.Balancers {
|
||||
|
Loading…
Reference in New Issue
Block a user