fix: Optimize container port detection mechanism

This commit is contained in:
ssongliu 2025-09-01 18:11:05 +08:00
parent bc95e47b92
commit b2ceb24272

View file

@ -213,7 +213,7 @@ func ScanPortWithProto(port int, proto string) bool {
}
func ScanPortWithIP(ip string, port int) bool {
if len(ip) == 0 {
if len(ip) == 0 || ip == "0.0.0.0" || ip == "::" {
return ScanPort(port)
}
address := net.JoinHostPort(ip, fmt.Sprintf("%d", port))