Add ice mdns config (#1311)

* Add use_mdns config

* Update config-sample.yaml

Co-authored-by: David Zhao <dz@livekit.io>

Co-authored-by: David Zhao <dz@livekit.io>
This commit is contained in:
cnderrauber
2023-01-18 16:51:49 +08:00
committed by GitHub
co-authored by David Zhao
parent 52d15637c2
commit bccf7a6842
3 changed files with 8 additions and 0 deletions
+3
View File
@@ -98,6 +98,9 @@ rtc:
# - 10.0.0.0/16
# excludes:
# - 192.168.1.0/24
# # Set to true to enable mDNS name candidate. This should be left disabled for most users.
# # when enabled, it will impact performance since each PeerConnection will process the same mDNS message independently
# use_mdns: true
# when enabled, LiveKit will expose prometheus metrics on :6789/metrics
# prometheus_port: 6789
+1
View File
@@ -81,6 +81,7 @@ type RTCConfig struct {
Interfaces InterfacesConfig `yaml:"interfaces"`
IPs IPsConfig `yaml:"ips"`
EnableLoopbackCandidate bool `yaml:"enable_loopback_candidate"`
UseMDNS bool `yaml:"use_mdns"`
// Number of packets to buffer for NACK
PacketBufferSize int `yaml:"packet_buffer_size,omitempty"`
+4
View File
@@ -90,6 +90,10 @@ func NewWebRTCConfig(conf *config.Config, externalIP string) (*WebRTCConfig, err
s.SetIPFilter(filter)
}
if !rtcConf.UseMDNS {
s.SetICEMulticastDNSMode(ice.MulticastDNSModeDisabled)
}
var nat1to1IPs []string
// force it to the node IPs that the user has set
if externalIP != "" && (conf.RTC.UseExternalIP || (conf.RTC.NodeIP != "" && !conf.RTC.NodeIPAutoGenerated)) {