From be49fcfd12c6e73649c0b2830d8645b573b5402e Mon Sep 17 00:00:00 2001 From: gVisor bot Date: Sun, 21 Aug 2022 08:43:57 +0800 Subject: [PATCH] Chore: the default sniffing is changed to a standard port, and the sniffing result is only used for this connection. --- component/sniffer/dispatcher.go | 4 +--- config/config.go | 3 ++- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/component/sniffer/dispatcher.go b/component/sniffer/dispatcher.go index cfcc58fb..cca8f719 100644 --- a/component/sniffer/dispatcher.go +++ b/component/sniffer/dispatcher.go @@ -12,7 +12,6 @@ import ( CN "github.com/Dreamacro/clash/common/net" "github.com/Dreamacro/clash/common/utils" - "github.com/Dreamacro/clash/component/resolver" C "github.com/Dreamacro/clash/constant" "github.com/Dreamacro/clash/log" ) @@ -84,8 +83,7 @@ func (sd *SnifferDispatcher) replaceDomain(metadata *C.Metadata, host string) { metadata.AddrType = C.AtypDomainName metadata.Host = host - metadata.DNSMode = C.DNSMapping - resolver.InsertHostByIP(metadata.DstIP, host) + metadata.DNSMode = C.DNSNormal } func (sd *SnifferDispatcher) Enable() bool { diff --git a/config/config.go b/config/config.go index 882a2de8..bef6efa1 100644 --- a/config/config.go +++ b/config/config.go @@ -977,7 +977,8 @@ func parseSniffer(snifferRaw RawSniffer) (*Sniffer, error) { var ports []utils.Range[uint16] if len(snifferRaw.Ports) == 0 { - ports = append(ports, *utils.NewRange[uint16](0, 65535)) + ports = append(ports, *utils.NewRange[uint16](80, 80)) + ports = append(ports, *utils.NewRange[uint16](443, 443)) } else { for _, portRange := range snifferRaw.Ports { portRaws := strings.Split(portRange, "-")