feat: "!"(not) support for geosite

eg. GEOSITE,!CN,Proxy & dns.fallback-filter.geosite: ['!CN']
This commit is contained in:
adlyq
2022-05-15 13:16:45 +08:00
parent 63917aa020
commit efc7c82cac
4 changed files with 33 additions and 15 deletions

View File

@@ -6,6 +6,7 @@ import (
"fmt"
"net"
"net/netip"
"strings"
"time"
"github.com/Dreamacro/clash/common/cache"
@@ -116,6 +117,14 @@ func msgToIP(msg *D.Msg) []netip.Addr {
return ips
}
func msgToDomain(msg *D.Msg) string {
if len(msg.Question) > 0 {
return strings.TrimRight(msg.Question[0].Name, ".")
}
return ""
}
type wrapPacketConn struct {
net.PacketConn
rAddr net.Addr