-
Notifications
You must be signed in to change notification settings - Fork 177
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(iroh-net): allow to set a custom DNS resolver on the magic e…
…ndpoint (#2116) ## Description This makes the DNS resolver to be used in the context of a MagicEndpoint configurable. Up to now, we used a single, global, unconfigurable DNS resolver, stored in a per-process global static. This PR changes this so that we can set a DNS resolver in the builder of the MagicEndpoint. This resolver is passed through to all places where we need a DNS resolver - which is all places where we need to resolve relay URLs. The default is unchanged: A single, shared DNS resolver is used for all endpoints. However, this default can now be changed per-endpoint. The global resolver is only used as a default in the endpoint builder if no custom resolver is set, and in the doctor, and in tests. This change will make testing things that use DNS - prominently: #2045 - much easier. And we now have the means in place for people to customize the DNS resolving, if needed. ## Notes & open questions This makes the `hickory_resolver::TokioAsyncResolver` part of the public API surface of `iroh-net`. ## Change checklist - [x] Self-review. - [x] Documentation updates if relevant. - [ ] Tests if relevant.
- Loading branch information
Showing
11 changed files
with
133 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.