fix tcp redirect when sniffing tls

This commit is contained in:
ginuerzh 2022-04-12 19:29:37 +08:00
parent 4808441fb3
commit 24f90c1ce3

View File

@ -210,12 +210,14 @@ func (h *redirectHandler) handleHTTPS(ctx context.Context, rw io.ReadWriter, rad
if host == "" {
host = dstAddr.String()
} else {
if _, _, err := net.SplitHostPort(host); err != nil {
_, port, _ := net.SplitHostPort(dstAddr.String())
if port == "" {
port = "443"
}
host = net.JoinHostPort(host, port)
}
}
log = log.WithFields(map[string]any{
"host": host,