Skip to content

Add stable server sorting and managed dialing policies - #230

Merged
yiguodev merged 10 commits into
mainfrom
codex/client-feature-enhancements
Oct 19, 2026
Merged

yiguodev merged 10 commits into
mainfrom
codex/client-feature-enhancements

Conversation

@yiguodev

@yiguodev yiguodev commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Keep server lists stable when latency measurements change, and add configurable address-family selection and Happy Eyeballs for App-managed connections.

Display preference → shared ServerCatalog → server browsers / exit picker / tray
Dialing preference → effective policy → physical proxy sockets + direct bootstrap DNS
  • Default to stable ID order, with persistent name and latency options. Display sorting stays independent of automatic fastest-node selection.
  • Add server dialing settings, reconnect confirmation for effective changes, JSON editing hints, and translations. Preserve system resolution with Happy Eyeballs off by default.
  • Apply dialing to Smart, ordinary Custom, and All VPN configurations, including Fragment and XHTTP physical endpoints. WireGuard peer resolution uses its own socket strategy and direct bootstrap DNS, including chained exits; its UDP transport does not use TCP Happy Eyeballs. Raw, Remnawave complete configurations, and advanced templates keep their existing behavior.
  • Register Android socket protection once per native process and bind it to the current VPN service so service recreation does not leave stale callbacks.

Evidence

  • Before: latency updates changed display order; controlled HTTP requests failed after Android VPN service recreation in the same native process.
    After: default ordering remains stable, and two consecutive dialing-setting reconnects in the same native process returned the expected HTTP response with Happy Eyeballs enabled and then disabled.
  • Flutter suite: 1,651 passed, 5 skipped. Android native suite: 54 passed. Analyzer, layer checks, changed-Dart formatting, and diff checks passed.
  • Android and macOS debug builds passed before the follow-up compiler fixes. Android emulator checks covered sorting, restart persistence, cancellation, equivalent-policy saves without reconnecting, and actual TUN traffic after reconnects.
  • Four controlled real-Core cases using App-generated configurations passed: bootstrap DNS recovery, Happy Eyeballs fallback, Fragment, and XHTTP main/download endpoints. The observed fallback delay was approximately 251 ms with the configured 250 ms attempt delay.
  • Follow-up compiler regressions passed for imported HE cleanup, effective XHTTP downloads, Fragment, WireGuard peers and chained exits, and configuration exclusions. Three additional real-Core cases passed using production compiler output: XHTTP with HE off returned HTTP 200, and WireGuard IPv4/IPv6 policies each sent a handshake datagram only on the requested family with direct bootstrap DNS. These WireGuard checks cover endpoint dialing, not a complete tunnel.
  • macOS validation was build-only. Physical devices, Apple VPN runtime, and Windows/Linux App VPN runtime were not tested.

Merge Danger

Door: two-way

No database schema or backup-format migration. Device preferences remain local, and default dialing preserves the existing system-resolution path.

Blast Radius: connections

Changes shared server display ordering, managed connection compilation, and Android VPN socket protection. Explicit dialing settings also affect bootstrap DNS and physical endpoint resolution.

Copilot AI balanced review requested due to automatic review settings October 19, 2026 14:08

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-19T14:43:33.628854Z 3de6671 New commits
🔒 Security Review ✅ Completed 2026-10-19T14:46:00.816829Z 3de6671 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b8b2c3aa11

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread lib/service/shared/xray/server_dialing.dart Outdated
Comment thread lib/service/shared/xray/server_dialing.dart
Copilot AI balanced review requested due to automatic review settings October 19, 2026 14:40

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@yiguodev
yiguodev merged commit fa85895 into main Oct 19, 2026
1 check passed
@yiguodev
yiguodev deleted the codex/client-feature-enhancements branch October 19, 2026 14:52
AnatomikPerq added a commit to AnatomikPerq/hp-client that referenced this pull request Oct 21, 2026
… dialing

Upstream added a server sort order (default, name, latency) and a
device-wide server dialing setting (Advanced → Xray): IPv4/IPv6
preference, Happy Eyeballs, and bootstrap DNS servers that resolve the
nodes' own domains outside the tunnel. The default compiles to AsIs and
changes nothing.

Fork changes on top:
- Dialing binds sockopt.interface only where the tunnel needs it
  (requiresInterface); upstream bound it in system proxy mode too.
- Outbounds that dial loopback (minewire engines) are left alone:
  Windows refuses a loopback dial bound to the interface.
- MinewireRuntime.applyTcpDns leaves the bootstrap resolvers on UDP;
  they go out direct.
- The sort button sits next to the fork's search field.

With dialing on, the bootstrap DNS lists the nodes' domains, so a node
switch changes the DNS section and restarts the Core instead of
switching live. It is opt-in; the default keeps live switching.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AnatomikPerq added a commit to AnatomikPerq/hp-client that referenced this pull request Oct 21, 2026
… unchecked

Remnawave with a real panel, the v2rayN User-Agent on existing subscriptions, leastPing and DNS from YuanDevTeam#220, server dialing from YuanDevTeam#230, the live switch with mode checks, layout details and the release build.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

2 participants