Skip to content

Commit

Permalink
chore: Adjust sniff logs
Browse files Browse the repository at this point in the history
  • Loading branch information
xishang0128 committed May 19, 2024
1 parent 4243a74 commit c504985
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions component/sniffer/dispatcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,13 @@ func (sd *SnifferDispatcher) TCPSniff(conn *N.BufferedConn, metadata *C.Metadata
}

func (sd *SnifferDispatcher) replaceDomain(metadata *C.Metadata, host string, overrideDest bool) {
// show log early, since the following code may mutate `metadata.Host`
log.Debugln("[Sniffer] Sniff %s [%s]-->[%s] success, replace domain [%s]-->[%s]",
metadata.NetWork,
metadata.SourceDetail(),
metadata.RemoteAddress(),
metadata.Host, host)
metadata.SniffHost = host
if overrideDest {
log.Debugln("[Sniffer] Sniff %s [%s]-->[%s] success, replace domain [%s]-->[%s]",
metadata.NetWork,
metadata.SourceDetail(),
metadata.RemoteAddress(),
metadata.Host, host)
metadata.Host = host
}
metadata.DNSMode = C.DNSNormal
Expand Down

0 comments on commit c504985

Please sign in to comment.