Wire BanditURLOverrides through to MutableURLTest#333
Wire BanditURLOverrides through to MutableURLTest#333myleshorton wants to merge 3 commits intomainfrom
Conversation
Pass per-proxy callback URLs from config response through to sing-box MutableURLTest URLOverrides, enabling per-ISP bandit proxy assignment on the client side. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR threads BanditURLOverrides from the loaded config through to Lantern’s MutableURLTestOutboundOptions.URLOverrides, enabling per-proxy URL test callback overrides to reach the sing-box mutable URL test implementation.
Changes:
- Extend
urlTestOutbound()andappendGroupOutbounds()to accepturlOverrides map[string]stringand forward it intoMutableURLTestOutboundOptions.URLOverrides. - Pass
cfg.BanditURLOverridesinto the Lantern server group’s URL test outbound; keep User/All URL test outbounds usingnil. - Update module dependencies (
go.mod/go.sum) to versions/branches that include the new options surface.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| vpn/vpn.go | Updates pre-start URL test outbound construction to the new urlTestOutbound signature (currently passing nil overrides). |
| vpn/tunnel_test.go | Updates tests to call urlTestOutbound with the new signature. |
| vpn/boxoptions.go | Wires BanditURLOverrides into the Lantern group’s MutableURLTest outbound and adds URLOverrides to the outbound options. |
| go.mod | Bumps common/lantern-box (and other deps) to versions needed for the new override option surface. |
| go.sum | Corresponding checksum updates after dependency changes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
vpn/vpn.go
Outdated
| tags = append(tags, ob.Tag) | ||
| } | ||
| outbounds = append(outbounds, urlTestOutbound("preTest", tags)) | ||
| outbounds = append(outbounds, urlTestOutbound("preTest", tags, nil)) |
There was a problem hiding this comment.
preTest() loads the config into cfg, but still calls urlTestOutbound("preTest", tags, nil), so BanditURLOverrides from the config are ignored during pre-start URL tests. If overrides are meant to affect URL testing behavior, they should be forwarded here as well (e.g., pass cfg.BanditURLOverrides).
| slog.Debug("Merged config options", "tags", lanternTags) | ||
|
|
||
| appendGroupOutbounds(&opts, servers.SGLantern, autoLanternTag, lanternTags) | ||
| appendGroupOutbounds(&opts, servers.SGLantern, autoLanternTag, lanternTags, cfg.BanditURLOverrides) |
There was a problem hiding this comment.
The PR introduces URLOverrides wiring for MutableURLTest, but the existing buildOptions tests only validate Outbounds membership. Consider adding an assertion that the autoLanternTag MutableURLTest outbound includes the expected URLOverrides when cfg.BanditURLOverrides is set, to prevent regressions.
| github.com/sagernet/sing v0.7.18 | ||
| github.com/sagernet/sing-box v1.12.13 | ||
| github.com/sagernet/sing-dns v0.4.6 | ||
| github.com/sagernet/sing-box v1.12.22 |
There was a problem hiding this comment.
github.com/sagernet/sing-box is still replaced with github.com/getlantern/sing-box-minimal v1.12.19-lantern (see replace directive at the top of this file), so bumping the required sing-box version to v1.12.22 doesn’t actually change the code you build against and can be confusing. Either align the replace target/version with the intended upgrade, or keep the required version consistent with what’s actually used via replace.
| github.com/sagernet/sing-box v1.12.22 | |
| github.com/sagernet/sing-box v1.12.19 |
Forward cfg.BanditURLOverrides into the preTest urlTestOutbound so bandit callback URLs are used during pre-start URL testing, not just during normal operation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Verify that URLOverrides from config.BanditURLOverrides are correctly forwarded into the auto-lantern MutableURLTestOutboundOptions. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
BanditURLOverridesfrom config response through to sing-boxMutableURLTestOutboundOptions.URLOverridesurlTestOutbound()andappendGroupOutbounds()to accept and forwardurlOverrides map[string]stringnilcommonandlantern-boxbandit-url-overrides branchesTest plan
go vet ./vpn/...passesTestConnectionandTestUpdateServersstill pass🤖 Generated with Claude Code