mirror of
https://github.com/XTLS/Xray-core.git
synced 2024-12-22 19:33:32 +02:00
Allow bulk definition of domain matcher at parent level (#713)
Co-authored-by: Shelikhoo <xiaokangwang@outlook.com>
This commit is contained in:
parent
0f79126379
commit
1adfc2720a
1 changed files with 7 additions and 0 deletions
|
@ -42,6 +42,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 {
|
||||
|
@ -82,6 +84,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 a new issue