fix tcp redirect when sniffing tls
This commit is contained in:
		| @ -210,11 +210,13 @@ func (h *redirectHandler) handleHTTPS(ctx context.Context, rw io.ReadWriter, rad | |||||||
| 	if host == "" { | 	if host == "" { | ||||||
| 		host = dstAddr.String() | 		host = dstAddr.String() | ||||||
| 	} else { | 	} else { | ||||||
| 		_, port, _ := net.SplitHostPort(dstAddr.String()) | 		if _, _, err := net.SplitHostPort(host); err != nil { | ||||||
| 		if port == "" { | 			_, port, _ := net.SplitHostPort(dstAddr.String()) | ||||||
| 			port = "443" | 			if port == "" { | ||||||
|  | 				port = "443" | ||||||
|  | 			} | ||||||
|  | 			host = net.JoinHostPort(host, port) | ||||||
| 		} | 		} | ||||||
| 		host = net.JoinHostPort(host, port) |  | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	log = log.WithFields(map[string]any{ | 	log = log.WithFields(map[string]any{ | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user