Skip to content

Conversation

Le-Maz
Copy link

@Le-Maz Le-Maz commented Jul 23, 2025

Description

This pull request adds support for passive mDNS discovery, enabling nodes to listen for peer advertisements without broadcasting their own presence on the local network.

Summary of changes:

  • Added advertise(bool) setter to MdnsDiscoveryBuilder (default true).
  • Modified MdnsDiscovery::new and spawn_discoverer to respect the advertise flag.

Breaking Changes

  • MdnsDiscovery::new(node_id: NodeId)MdnsDiscovery::new(node_id: NodeId, advertise: bool)
    Code using MdnsDiscovery::new must now provide the advertise argument explicitly.

Notes & Open Questions

Change Checklist

  • Self-review.
  • Documentation updates following the style guide.
  • Tests if relevant.
  • All breaking changes documented.

@n0bot n0bot bot added this to iroh Jul 23, 2025
@github-project-automation github-project-automation bot moved this to 🏗 In progress in iroh Jul 23, 2025
@matheus23
Copy link
Member

The test failure in CI is not your fault. I've created #3404 to fix them. Once that's merged you can rebase on main (or merge main into your branch) and CI should be good.

@dignifiedquire dignifiedquire requested a review from ramfox July 28, 2025 10:10
Copy link
Member

@ramfox ramfox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

Needs to be rebased first, but then it can be merged.

Le-Maz added 6 commits July 30, 2025 10:08
Adds an `advertise` option to control whether a node broadcasts its
presence via mDNS. When false, the node will only listen for other peers
without advertising itself.

This is useful for ephemeral nodes that need to discover services
without spamming the local network with their own short-lived IDs.
@Le-Maz Le-Maz force-pushed the Le-Maz/passive-mdns-discovery branch from e395ee1 to 3398d4c Compare July 30, 2025 08:09
@Le-Maz
Copy link
Author

Le-Maz commented Jul 30, 2025

Rebased the commits.

@Le-Maz Le-Maz requested a review from ramfox July 30, 2025 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🏗 In progress
Development

Successfully merging this pull request may close these issues.

4 participants