Answer dtls server role for ice lite and full (#5260)

Full ice also get benefit from this when warp is enabled.
This commit is contained in:
cnderrauber authored and GitHub committed 2026-11-23 12:49:03 +08:00
1 parent 95eded4fe6
commit d731caa8da
3 files changed
+3 -8

No files matched your search

-3
View File
@@ -38,7 +38,6 @@ type WebRTCConfig struct {
Receiver ReceiverConfig
Publisher DirectionConfig
Subscriber DirectionConfig
ICELite bool
flexFEC config.FlexFECConfig
}
@@ -103,14 +102,12 @@ func NewWebRTCConfig(conf *config.Config) (*WebRTCConfig, error) {
},
Publisher: getPublisherConfig(false, flexFEC),
Subscriber: subscriberConfig,
ICELite: rtcConf.UseICELite,
flexFEC: flexFEC,
}, nil
}
func (c *WebRTCConfig) DisableICELite() {
c.SettingEngine.SetLite(false)
c.ICELite = false
}
func (c *WebRTCConfig) UpdatePublisherConfig(consolidated bool) {
+1 -3
View File
@@ -410,7 +410,6 @@ func newPeerConnection(
//
se.DisableSRTPReplayProtection(true)
se.DisableSRTCPReplayProtection(true)
iceLite := params.Config.ICELite
if !params.ProtocolVersion.SupportsICELite() || !params.ClientInfo.SupportsPrflxOverRelay() {
// if client don't support prflx over relay which is only Firefox, disable ICE Lite to ensure that
// aggressive nomination is handled properly. Firefox does aggressive nomination even if peer is
@@ -420,9 +419,8 @@ func newPeerConnection(
// ending up with different candidates.
// As Firefox does not support migration, ICE Lite can be disabled.
se.SetLite(false)
iceLite = false
}
if iceLite && params.ClientInfo.SupportsAnswerDTLSRoleServer() {
if params.ClientInfo.SupportsAnswerDTLSRoleServer() {
_ = se.SetAnsweringDTLSRole(webrtc.DTLSRoleServer)
}
// ICE checks already prove the remote address, so the HelloVerifyRequest cookie only adds a round trip.
+2 -2
View File
@@ -1158,13 +1158,13 @@ func TestAnsweringDTLSRole(t *testing.T) {
expected sdp.ConnectionRole
}{
{name: "ice lite", iceLite: true, clientInfo: sdkInfo(livekit.ClientInfo_JS), expected: sdp.ConnectionRolePassive},
{name: "no ice lite", clientInfo: sdkInfo(livekit.ClientInfo_JS), expected: sdp.ConnectionRoleActive},
{name: "no ice lite", clientInfo: sdkInfo(livekit.ClientInfo_JS), expected: sdp.ConnectionRolePassive},
{name: "unknown sdk", iceLite: true, clientInfo: ClientInfo{}, expected: sdp.ConnectionRoleActive},
{name: "esp32", iceLite: true, clientInfo: sdkInfo(livekit.ClientInfo_ESP32), expected: sdp.ConnectionRoleActive},
}
for _, c := range cases {
t.Run(c.name, func(t *testing.T) {
conf := &WebRTCConfig{ICELite: c.iceLite}
conf := &WebRTCConfig{}
conf.SettingEngine.SetLite(c.iceLite)
answerer, err := NewPCTransport(TransportParams{
Config: conf,