mirror of
https://github.com/livekit/livekit.git
synced 2026-12-04 04:58:22 +00:00
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:
1 parent
95eded4fe6
commit
d731caa8da
3 files changed
+3
-8
No files matched your search
@@ -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) {
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user