Allow callers to override smart_dialer_config.yml#35
Merged
Conversation
The embedded smart_dialer_config.yml lists `system: {}` first under DNS,
which makes the Outline-SDK strategy fall back to the OS resolver. The
strategy then requires the base StreamDialer to be exactly
*transport.TCPDialer (smart/stream_dialer.go:350), rejecting any other
type with "cannot use system resolver with base dialer of type %T".
Callers passing a custom StreamDialer that isn't *transport.TCPDialer
(notably radiance's bypass dialer, which is a FuncStreamDialer) need to
also supply a strategy config that omits `system: {}` so the strategy
routes every probe through their dialer.
Adds:
- WithSmartDialerConfig([]byte) Option for the WithProxyless path
- NewSmartHTTPTransportWithConfig() for the standalone helper path
- Empty-config validation matching the rest of the option family
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds support for overriding the embedded smart dialer YAML config so callers using custom dialers can avoid the default system: {} resolver path.
Changes:
- Adds
WithSmartDialerConfig([]byte)forWithProxyless. - Adds
NewSmartHTTPTransportWithConfig(...)for standalone smart transport construction. - Updates tests for deferred config plumbing and empty config rejection in the option path.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
kindling.go |
Adds smart dialer config plumbing through options and standalone transport helper. |
kindling_test.go |
Updates smart dialer test hook signature and adds config-order/empty-config tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- NewSmartHTTPTransportWithConfig now rejects non-nil empty slices, matching WithSmartDialerConfig's strictness. Prevents a callers' `make([]byte, 0)` mistake from silently skipping the embedded default and handing outline-sdk empty YAML. - Add TestNewSmartHTTPTransportWithConfig with three subtests: config arg plumbed through, nil → embedded fallback, empty → error. Closes the gap Copilot flagged: prior tests only covered the WithProxyless option path.
This was referenced May 16, 2026
myleshorton
added a commit
to getlantern/lantern
that referenced
this pull request
May 16, 2026
Pulls in getlantern/radiance#485, which routes kindling smart-strategy probes through the bypass dialer so kindling traffic doesn't loop back through the VPN TUN. Transitively bumps kindling to a9712f9 (getlantern/kindling#35) for the WithSmartDialerConfig surface.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #34. Lets callers replace the embedded
smart_dialer_config.ymlso a customStreamDialerplumbed viaWithStreamDialeris actually exercised by the smart strategy.Why
The embedded config lists
system: {}first under DNS. When the Outline-SDK strategy picks the system resolver (which it does whenever the probe path doesn't fail), it enforces this check atsmart/stream_dialer.go:350:So any caller that supplies a
StreamDialerthat isn't exactly*transport.TCPDialer— e.g. radiance's bypass dialer, which is aFuncStreamDialerwrappingbypass.DialContext— sees the smart dialer fail at construction.findFallbackis then called and errors out with "no fallback was specified" because the kindling config has noFALLBACKsection.Semantically this constraint is correct:
system: {}uses the OS resolver, which routes through OS routing tables. For radiance, that means through its own VPN TUN — defeating the entire purpose of bypass. The strategy's type check is honest: "if you're using system DNS, you can't also be doing custom transport routing."The fix is to let callers swap in a config that omits
system: {}(using DoH/DoT entries that go through the StreamDialer) when they pass a custom dialer.Changes
WithSmartDialerConfig([]byte) Option— overrides the embedded YAML for theWithProxylesspath. Order-independent with the other dialer options (same deferred-construction pattern as Allow callers to plug a custom dialer into the smart strategy #34).NewSmartHTTPTransportWithConfig(...)— same override for the standalone helper used byradiance/kindling/smart.NewSmartHTTPTransportWithDialeris preserved (delegates to the new helper withnilconfig).ProxylessConfigOrderIndependent— config supplied before and afterWithProxylessreachesnewSmartDialerFn.WithSmartDialerConfig_Empty_ReturnsError— nil and empty[]byteboth rejected at option time.Test plan
go test ./...passes (existingProxylessDialerOrderIndependenttest updated for the newnewSmartDialerFnsignature)NewSmartHTTPTransportWithConfig+ asystem-less YAML resolves the smart strategy through the bypass dialer — to be verified once this lands and radiance bumps the dep🤖 Generated with Claude Code