hysteria/app/internal/tun/check_ipv6_unix.go
2024-12-29 13:33:32 +09:00

16 lines
245 B
Go

//go:build unix
package tun
import (
"golang.org/x/sys/unix"
)
func isIPv6Supported() bool {
sock, err := unix.Socket(unix.AF_INET6, unix.SOCK_DGRAM, unix.IPPROTO_UDP)
if err != nil {
return false
}
_ = unix.Close(sock)
return true
}