mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-02-20 23:47:21 -05:00
tolerate domain type names as much as possible.
This commit is contained in:
parent
a96babf4d4
commit
6db7935b8c
@ -171,6 +171,12 @@ func (c *DnsConfig) Build() (*dns.Config, error) {
|
||||
mapping.Type = dns.DomainMatchingType_Keyword
|
||||
mapping.Domain = domain[8:]
|
||||
|
||||
mappings = append(mappings, mapping)
|
||||
} else if strings.HasPrefix(domain, "full:") {
|
||||
mapping := getHostMapping(addr)
|
||||
mapping.Type = dns.DomainMatchingType_Full
|
||||
mapping.Domain = domain[5:]
|
||||
|
||||
mappings = append(mappings, mapping)
|
||||
} else {
|
||||
mapping := getHostMapping(addr)
|
||||
|
@ -286,6 +286,9 @@ func parseDomainRule(domain string) ([]*router.Domain, error) {
|
||||
case strings.HasPrefix(domain, "full:"):
|
||||
domainRule.Type = router.Domain_Full
|
||||
domainRule.Value = domain[5:]
|
||||
case strings.HasPrefix(domain, "keyword:"):
|
||||
domainRule.Type = router.Domain_Plain
|
||||
domainRule.Value = domain[8:]
|
||||
default:
|
||||
domainRule.Type = router.Domain_Plain
|
||||
domainRule.Value = domain
|
||||
|
Loading…
x
Reference in New Issue
Block a user