mirror of
https://github.com/netbirdio/netbird.git
synced 2026-04-16 15:26:40 +00:00
When NB_FORCE_RELAY is enabled, skip WorkerICE creation entirely, suppress ICE credentials in offer/answer messages, disable the periodic ICE candidate monitor, and fix isConnectedOnAllWay to only check relay status so the guard stops sending unnecessary offers.
19 lines
244 B
Go
19 lines
244 B
Go
package peer
|
|
|
|
import (
|
|
"os"
|
|
"runtime"
|
|
"strings"
|
|
)
|
|
|
|
const (
|
|
EnvKeyNBForceRelay = "NB_FORCE_RELAY"
|
|
)
|
|
|
|
func IsForceRelayed() bool {
|
|
if runtime.GOOS == "js" {
|
|
return true
|
|
}
|
|
return strings.EqualFold(os.Getenv(EnvKeyNBForceRelay), "true")
|
|
}
|