Improve load geosite

This commit is contained in:
世界
2022-07-08 11:00:46 +08:00
parent 9c256afc1a
commit d45007b501
4 changed files with 33 additions and 29 deletions

View File

@@ -8,7 +8,6 @@ import (
N "github.com/sagernet/sing/common/network"
"github.com/sagernet/sing-box/common/geoip"
"github.com/sagernet/sing-box/common/geosite"
C "github.com/sagernet/sing-box/constant"
"golang.org/x/net/dns/dnsmessage"
@@ -21,7 +20,7 @@ type Router interface {
RouteConnection(ctx context.Context, conn net.Conn, metadata InboundContext) error
RoutePacketConnection(ctx context.Context, conn N.PacketConn, metadata InboundContext) error
GeoIPReader() *geoip.Reader
GeositeReader() *geosite.Reader
LoadGeosite(code string) (Rule, error)
Exchange(ctx context.Context, message *dnsmessage.Message) (*dnsmessage.Message, error)
Lookup(ctx context.Context, domain string, strategy C.DomainStrategy) ([]netip.Addr, error)
LookupDefault(ctx context.Context, domain string) ([]netip.Addr, error)