Skip to content

feat(configurl): add typed registries for SmartDialer extensions - #647

Draft
fortuna wants to merge 6 commits into
mainfrom
feat/smart-configurl-registry
Draft

fortuna wants to merge 6 commits into
mainfrom
feat/smart-configurl-registry

Conversation

@fortuna

@fortuna fortuna commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

SmartDialer currently creates separate configurl providers for TLS and fallback searches, so applications cannot consistently register custom components or inject base dialers across those paths. This change lets SmartDialer and Mobileproxy use a configured registry throughout DNS discovery, TLS construction, and fallback parsing.

  • configurl.Registry exposes LookupParser; MutableRegistry adds registration. Generic New, Parse, Register, and Lookup support arbitrary result types. MakeNew[T](registry) supplies a bound dependency function, so component parsers take only context and config. Built-in registration helpers retain explicit dependencies.
  • Base parsers use the empty registration name and receive a nil config. RegisterBase installs a parser; RegisterInstance injects an existing value. Smart options accept a mutable registry and wrap its default stream parser once on the first successful New(), after all component/base registrations are complete.
  • During TLS search, the registered base parser reads a function from the construction context that returns the single selected DNS dialer and cache. This applies to nested configs too. Config URLs remain unchanged, searches do not mutate registrations, and ordinary DNS/fallback construction retains the original base. Packet bases are unaffected.
  • StrategyFinderOptions provides fluent setup and validation. Mobileproxy exposes its registry to Go component helpers and fallback parsers. Deprecated finder dialer fields remain supported through first-use normalization and are mutually exclusive with an explicitly configured registry.

The released concrete ProviderContainer API remains intact, without rename aliases or deprecations. The unreleased concrete Registry API from #646 is replaced by these interfaces; existing provider callers retain their original API.

Validation: full x module race suite and staticcheck pass. Coverage includes external registry implementations, arbitrary result types, bound dependency lookup, concurrent TLS searches, nested configs, DNS dialer identity/cache reuse, fallback isolation after TLS failure, cached YAML fallbacks, legacy compatibility, and Mobileproxy registration. Java and Objective-C binding generation passes with a custom component wrapper; native Android/iOS packaging was not run locally.

Keep this PR in draft. Developer documentation follow-ups remain held until the final API is released in the x module.

Base automatically changed from refactor/configurl-registry to main October 19, 2026 11:23
@fortuna fortuna changed the title feat(smart): support custom config URL components feat(configurl): support derived registries in SmartDialer Oct 20, 2026
@fortuna fortuna changed the title feat(configurl): support derived registries in SmartDialer feat(configurl): add typed registries for SmartDialer extensions Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant