chore: adjust log
This commit is contained in:
parent
7818213bc8
commit
86fe3c1f24
1 changed files with 10 additions and 20 deletions
|
@ -94,29 +94,19 @@ func (sd *SnifferDispatcher) TCPSniff(conn net.Conn, metadata *C.Metadata) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (sd *SnifferDispatcher) replaceDomain(metadata *C.Metadata, host string, overrideDest bool) {
|
func (sd *SnifferDispatcher) replaceDomain(metadata *C.Metadata, host string, overrideDest bool) {
|
||||||
dstIP := ""
|
|
||||||
if metadata.DstIP.IsValid() {
|
|
||||||
dstIP = metadata.DstIP.String()
|
|
||||||
}
|
|
||||||
originHost := metadata.Host
|
originHost := metadata.Host
|
||||||
if originHost != host {
|
if originHost != host {
|
||||||
log.Infoln("[Sniffer] Sniff TCP [%s]-->[%s:%s] success, replace domain [%s]-->[%s]",
|
if overrideDest {
|
||||||
metadata.SourceDetail(),
|
metadata.Host = host
|
||||||
dstIP, metadata.DstPort,
|
} else {
|
||||||
metadata.Host, host)
|
metadata.SniffHost = host
|
||||||
} else {
|
}
|
||||||
log.Debugln("[Sniffer] Sniff TCP [%s]-->[%s:%s] success, replace domain [%s]-->[%s]",
|
metadata.DNSMode = C.DNSNormal
|
||||||
metadata.SourceDetail(),
|
|
||||||
dstIP, metadata.DstPort,
|
|
||||||
metadata.Host, host)
|
|
||||||
}
|
}
|
||||||
|
log.Debugln("[Sniffer] Sniff TCP [%s]-->[%s] success, replace domain [%s]-->[%s]",
|
||||||
if overrideDest {
|
metadata.SourceDetail(),
|
||||||
metadata.Host = host
|
metadata.RemoteAddress(),
|
||||||
} else {
|
metadata.Host, host)
|
||||||
metadata.SniffHost = host
|
|
||||||
}
|
|
||||||
metadata.DNSMode = C.DNSNormal
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (sd *SnifferDispatcher) Enable() bool {
|
func (sd *SnifferDispatcher) Enable() bool {
|
||||||
|
|
Loading…
Reference in a new issue