chore: setting sniffHost value
This commit is contained in:
parent
51cbc532db
commit
7021dc1878
1 changed files with 4 additions and 8 deletions
|
@ -94,15 +94,11 @@ 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) {
|
||||||
originHost := metadata.Host
|
metadata.SniffHost = host
|
||||||
if originHost != host {
|
if overrideDest {
|
||||||
if overrideDest {
|
metadata.Host = host
|
||||||
metadata.Host = host
|
|
||||||
} else {
|
|
||||||
metadata.SniffHost = host
|
|
||||||
}
|
|
||||||
metadata.DNSMode = C.DNSNormal
|
|
||||||
}
|
}
|
||||||
|
metadata.DNSMode = C.DNSNormal
|
||||||
log.Debugln("[Sniffer] Sniff TCP [%s]-->[%s] success, replace domain [%s]-->[%s]",
|
log.Debugln("[Sniffer] Sniff TCP [%s]-->[%s] success, replace domain [%s]-->[%s]",
|
||||||
metadata.SourceDetail(),
|
metadata.SourceDetail(),
|
||||||
metadata.RemoteAddress(),
|
metadata.RemoteAddress(),
|
||||||
|
|
Loading…
Reference in a new issue