[client] Implement environment variable handling for Android (#4440)

Some features can only be manipulated via environment variables. With this PR, environment variables can be managed from Android.
This commit is contained in:
Zoltan Papp
2025-09-08 18:42:42 +02:00
committed by GitHub
parent dba7ef667d
commit 7aef0f67df
4 changed files with 63 additions and 4 deletions

View File

@@ -6,7 +6,6 @@ import (
"math/rand"
"net"
"net/netip"
"os"
"runtime"
"sync"
"time"
@@ -174,7 +173,7 @@ func (conn *Conn) Open(engineCtx context.Context) error {
conn.handshaker = NewHandshaker(conn.Log, conn.config, conn.signaler, conn.workerICE, conn.workerRelay)
conn.handshaker.AddOnNewOfferListener(conn.workerRelay.OnNewOffer)
if os.Getenv("NB_FORCE_RELAY") != "true" {
if !isForceRelayed() {
conn.handshaker.AddOnNewOfferListener(conn.workerICE.OnNewOffer)
}