Add IncludeLoopbackCandidate option

This commit is contained in:
sergystepanov 2026-06-08 11:07:31 +03:00
parent c5886c5b1b
commit 67cd92da6b
3 changed files with 9 additions and 7 deletions

View file

@ -436,6 +436,7 @@ webrtc:
icePorts:
min:
max:
includeLoopbackCandidate: false
# 2. select a single port to forward all ICE connections there
singlePort:
# override ICE candidate IP, see: https://github.com/pion/webrtc/issues/835,

View file

@ -8,12 +8,13 @@ type Webrtc struct {
Min uint16
Max uint16
}
IceIpMap string
IceLite bool
IpFilter []string
IpFilterRemote []string
SinglePort int
LogLevel int
IceIpMap string
IceLite bool
IpFilter []string
IpFilterRemote []string
IncludeLoopbackCandidate bool
SinglePort int
LogLevel int
}
type IceServer struct {

View file

@ -38,7 +38,7 @@ func NewApiFactory(conf config.Webrtc, log *logger.Logger, mod ModApiFun) (api *
}
customLogger := NewPionLogger(log, conf.LogLevel)
s := webrtc.SettingEngine{LoggerFactory: customLogger}
s.SetIncludeLoopbackCandidate(true)
s.SetIncludeLoopbackCandidate(conf.IncludeLoopbackCandidate)
if conf.HasDtlsRole() {
log.Info().Msgf("A custom DTLS role [%v]", conf.DtlsRole)
err = s.SetAnsweringDTLSRole(webrtc.DTLSRole(conf.DtlsRole))