新增调试信息

This commit is contained in:
2025-10-27 22:15:25 +08:00
parent ae62457d8c
commit 04642cb2f0
5479 changed files with 683397 additions and 3450 deletions
+25
View File
@@ -0,0 +1,25 @@
package common
import (
"net"
"net/netip"
"time"
)
func CanConnectIPv6Addr(remoteAddr netip.AddrPort) bool {
dialer := net.Dialer{
Timeout: 1 * time.Second,
}
conn, err := dialer.Dial("tcp6", remoteAddr.String())
if err != nil {
return false
}
defer conn.Close()
return true
}
func CanConnectIPv6() bool {
return CanConnectIPv6Addr(netip.MustParseAddrPort("[2001:4860:4860::8888]:80"))
}