DNSMode == C.DNSMapping && sd.forceDnsMapping) { if sd.shouldOverride(metadata) { inWhitelist := false overrideDest := false for sniffer, config := range sd.sniffers { @@ -125,7 +159,7 @@ func (sd *SnifferDispatcher) sniffDomain(conn *N.BufferedConn, metadata *C.Metad continue ...
DNSMode == C.DNSMapping && sd.forceDnsMapping { return true } for _, rule := range sd.forceDomain { if ok, _ := rule.Match(&C.Metadata{Host: metadata.Host}); ok { return true } } return false } func (sd *SnifferDispatcher) UDPSniff(packet C.PacketAdapter) bool { @@ -94,...
metadata.DNSMode = C.DNSMapping } resolver.InsertHostByIP(metadata.DstIP, host) break } } } func NewSnifferDispatcher(needSniffer []C.SnifferType, force bool) (SnifferDispatcher, error) { dispatcher := SnifferDispatcher{ enable: true, force: force, } for _, snifferName := range needSniff...
Mode*tunnel.TunnelMode`json:"mode"` LogLevel*log.LogLevel`json:"log-level"` IPv6*bool`json:"ipv6"` Sniffing*bool`json:"sniffing"` } funcgetConfigs(whttp.ResponseWriter,r*http.Request) { Expand DownExpand Up@@ -67,6 +68,10 @@ func patchConfigs(w http.ResponseWriter, r *http.Request...
DNSMode == C.DNSMapping && sd.forceDnsMapping) { if sd.shouldOverride(metadata) { inWhitelist := false overrideDest := false for sniffer, config := range sd.sniffers { @@ -125,7 +159,7 @@ func (sd *SnifferDispatcher) sniffDomain(conn *N.BufferedConn, metadata *C.Metad continue ...