rule: allow to use root domains like com/net/cn... #43

This commit is contained in:
nadoo committed 2019-03-07 00:19:30 +08:00
1 parent 8c922db612
commit f9a21f5951
5 files changed
+12 -6

No files matched your search

+2 -2
View File
@@ -85,7 +85,7 @@ func (rd *Dialer) NextDialer(dstAddr string) proxy.Dialer {
domainParts := strings.Split(host, ".")
length := len(domainParts)
for i := length - 2; i >= 0; i-- {
for i := length - 1; i >= 0; i-- {
domain := strings.Join(domainParts[i:length], ".")
// find in domainMap
@@ -112,7 +112,7 @@ func (rd *Dialer) AddDomainIP(domain, ip string) error {
if ip != "" {
domainParts := strings.Split(domain, ".")
length := len(domainParts)
for i := length - 2; i >= 0; i-- {
for i := length - 1; i >= 0; i-- {
pDomain := strings.ToLower(strings.Join(domainParts[i:length], "."))
// find in domainMap