diff --git a/health/health.go b/health/health.go index 314107cfa..01c79dd65 100644 --- a/health/health.go +++ b/health/health.go @@ -10,6 +10,7 @@ import ( "errors" "fmt" "os" + "runtime" "sort" "sync" "sync/atomic" @@ -347,6 +348,12 @@ var ( receiveFuncs = []*ReceiveFuncStats{&ReceiveIPv4, &ReceiveIPv6, &ReceiveDERP} ) +func init() { + if runtime.GOOS == "js" { + receiveFuncs = receiveFuncs[2:] // ignore IPv4 and IPv6 + } +} + // ReceiveFuncStats tracks the calls made to a wireguard-go receive func. type ReceiveFuncStats struct { // name is the name of the receive func.