Env var to force relay usage

This commit is contained in:
Zoltán Papp 2024-06-26 15:25:32 +02:00
parent 745e4f76b1
commit 0a59f12012

View File

@ -4,6 +4,7 @@ import (
"context"
"math/rand"
"net"
"os"
"runtime"
"strings"
"sync"
@ -155,7 +156,9 @@ func NewConn(engineCtx context.Context, config ConnConfig, statusRecorder *Statu
}
conn.handshaker.AddOnNewOfferListener(conn.workerRelay.OnNewOffer)
conn.handshaker.AddOnNewOfferListener(conn.workerICE.OnNewOffer)
if os.Getenv("NB_FORCE_RELAY") != "true" {
conn.handshaker.AddOnNewOfferListener(conn.workerICE.OnNewOffer)
}
go conn.handshaker.Listen()