Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: disable multicast dns in native webrtc connection #520

Merged
merged 1 commit into from
Jan 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 2 additions & 12 deletions crates/node/src/logging.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,20 +149,11 @@ pub mod node {
let subscriber = Registry::default();
let level_filter = filter::LevelFilter::from_level(level.into());

// Filter floating log of mdns
let mdns_log_filter = filter::FilterFn::new(|metadata| {
!metadata.target().starts_with("webrtc_mdns::conn")
|| [276, 322]
.iter()
.all(|&line| !metadata.line().unwrap_or_default() == line)
});

// Stderr
let subscriber = subscriber.with(
fmt::layer()
.with_writer(std::io::stderr)
.with_filter(level_filter)
.with_filter(mdns_log_filter.clone()),
.with_filter(level_filter),
);

// Jaeger
Expand All @@ -178,8 +169,7 @@ pub mod node {
subscriber.with(Some(
tracing_opentelemetry::layer()
.with_tracer(jaeger)
.with_filter(level_filter)
.with_filter(mdns_log_filter),
.with_filter(level_filter),
))
} else {
subscriber.with(None)
Expand Down
5 changes: 2 additions & 3 deletions crates/transport/src/connections/native_webrtc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,9 @@ impl TransportInterface for WebrtcTransport {
if let Some(ref addr) = self.external_address {
tracing::debug!("setting external ip {:?}", addr);
setting.set_nat_1to1_ips(vec![addr.to_string()], RTCIceCandidateType::Host);
setting.set_ice_multicast_dns_mode(MulticastDnsMode::QueryOnly);
setting.set_ice_multicast_dns_mode(MulticastDnsMode::Disabled);
} else {
// mDNS gathering cannot be used with 1:1 NAT IP mapping for host candidate
setting.set_ice_multicast_dns_mode(MulticastDnsMode::QueryAndGather);
setting.set_ice_multicast_dns_mode(MulticastDnsMode::Disabled);
}

let webrtc_api = webrtc::api::APIBuilder::new()
Expand Down