From a146e559788ca258981f7cd8856a4c43a3ea9822 Mon Sep 17 00:00:00 2001 From: Alessandro Ros Date: Mon, 10 Aug 2026 14:00:23 +0200 Subject: [PATCH] webrtc: improve performance by ignoring mDNS candidates (#4963) (#6064) mDNS candidates sometimes require a large CPU portion, they are not involved in any connectivity method mentioned in the documentation, they work in local networks only. --- internal/protocols/webrtc/peer_connection.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/internal/protocols/webrtc/peer_connection.go b/internal/protocols/webrtc/peer_connection.go index 9f0c3bb5..21c372e0 100644 --- a/internal/protocols/webrtc/peer_connection.go +++ b/internal/protocols/webrtc/peer_connection.go @@ -244,6 +244,12 @@ func (co *PeerConnection) Start() error { settingsEngine.SetNet(co.Net) + // Do not generate mDNS candidates and do not use mDNS candidates of remote peers. + // * they sometimes require a large CPU portion + // * they are not involved in any connectivity method mentioned in the documentation + // * they work in local networks only + settingsEngine.SetICEMulticastDNSMode(ice.MulticastDNSModeDisabled) + mediaEngine := &webrtc.MediaEngine{} if co.Publish {