Skip to content

fix: honor desktop process exclusions across DNS and local proxies - #27

Merged
acking-you merged 3 commits into
devfrom
codex/direct-process-dns
Oct 17, 2026
Merged

acking-you merged 3 commits into
devfrom
codex/direct-process-dns

Conversation

@acking-you

@acking-you acking-you commented Oct 17, 2026 •

Copy link
Copy Markdown
Owner

Excluded Windows applications could still reach the local HTTP/SOCKS listener through system-proxy settings, while their DNS answers came from the remote exit. Launcher selection also deleted explicit child rules, and choosing ERROR in the UI stopped INFO diagnostics from reaching disk.

This change makes exclusions consistent across TUN and local proxy ingress:

  • Desktop DNS uses physical-interface sockets with ordered AliDNS 223.5.5.5, Tencent DNSPod 119.29.29.29, AliDNS 223.6.6.6, then adapter/custom fallbacks. Saved resolver settings remain intact. Platform-managed mobile/macOS Network Extension DNS retains its separate proxy path.
  • Reuse TUN owner matching and physical connectors for local HTTP, CONNECT and SOCKS TCP/UDP. Exclude the listener PID before ancestor matching; never attribute LAN clients to local processes. Loopback services need no physical adapter; localhost and IPv4-mapped loopback retain local routing. Failed IPv4 domain connections retry IPv6. Cached Fake-IP mappings remain available.
  • Preserve explicit child exclusions and apply rule updates to the local listener as well as TUN. Existing affected connections close only when their decision changes.
  • Persist full native INFO+ diagnostics before UI filtering/throttling using a bounded rotating writer. Shutdown reliably drains a full queue, and retention skips files owned by live instances without preventing readers from opening logs. Keep complete request destinations and error chains; report queue overflow and disk errors.
  • Preserve empty and large UDP datagrams, authorize direct UDP replies before sending to avoid a fast-reply race, revoke failed/cancelled pending sends without invalidating prior successes, and log interface, socket endpoints, datagram counts and close reason. Windows adapter discovery no longer probes gateway MAC addresses synchronously.

Merged companion PRs (root gitlinks reference the merged commits; their source trees match the verified branches):

Validation on the maintainer's Windows machine:

  • cargo test --workspace --locked — 280 passed, 8 ignored (including the child-process helper invoked explicitly by its parent regression).
  • cargo clippy -p proxy-crypto -p proxy-core -p proxy-client -p proxy-server -p proxy-tui -p proxy-ffi --all-targets --all-features --no-deps -- -D warnings
  • cargo fmt -p proxy-crypto -p proxy-core -p proxy-client -p proxy-server -p proxy-tui -p proxy-ffi -- --check
  • cargo check -p proxy-client --no-default-features --locked
  • cargo check -p proxy-ffi --target aarch64-linux-android --locked with local NDK.
  • tun2proxy: 87 tests, strict Clippy and formatting passed; ipstack: 13 unit + 23 doc tests, strict Clippy and formatting passed.
  • fvm flutter analyze --no-fatal-infos and fvm flutter test --no-pub — 123 passed, 3 platform skips; analysis has 26 pre-existing informational notices.
  • Isolated scripts/windows/build.ps1 -Configuration Debug -Offline -VisualStudioPath <VS2022 BuildTools> passed. Verified CipherRelay.exe, fresh http_proxy.dll, wintun.dll, flutter_windows.dll, plugin files and asset data; the application was never launched.

Three local review passes checked ownership/self-loop prevention and live updates; DNS fallback/framing/Fake-IP compatibility and cancellation; then UDP boundaries, reply authorization and logging failure paths. Focused regressions also cover IPv6-only localhost, mapped loopback, UDP peer rollback, a full shutdown queue, and simultaneous readable log files during retention. UDP DNS cache pressure evicts expired/oldest entries individually; fallback DNS failures cannot hide the preceding socket error. The isolated HTTP/SOCKS/UDP test fell from about 25 s to 0.43 s after removing Windows ARP probing. The UDP corruption was reproduced before the fix using simulated packets and exercised through a loopback relay afterward.

Before/after host snapshots confirm the active TUN PID/start time, routes, interface addresses, DNS, system proxy and preferences SHA-256 are unchanged. No live match was running, so this does not claim a completed in-game latency validation. Incoming IP fragment reassembly remains outside this change. Previously deleted executable selections cannot be reconstructed automatically; users should reselect those rules once after upgrading.

Native client/server wire protocol and exported FFI layouts are unchanged. README and docs/client-usage.md describe DNS precedence, platform differences, selection behavior and disk log rotation. This PR does not publish a release or overwrite an installed application.

Standalone tun2proxy CI now uses the consumer toolchain and a committed dependency lock (including the same libc version as this workspace). Its legacy external-test matrix captures each parameter combination correctly and explicitly skips unavailable credentials/IPv6 routes. Mobile CI is compilation-only; no package is published.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 17, 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-17T18:00:29.928476Z 402f4cd PR opened
ℹ️ 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.

Comment thread crates/proxy-client/src/client/mod.rs Resolved
Comment thread crates/proxy-client/src/client/udp.rs Resolved

@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: 402f4cdbb0

ℹ️ 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 crates/proxy-core/src/datagram.rs Resolved
Comment thread crates/proxy-ffi/src/disk_log.rs Resolved
Comment thread crates/proxy-ffi/src/disk_log.rs Resolved
Comment thread crates/proxy-client/src/client/mod.rs Resolved
Comment thread crates/proxy-client/src/client/mod.rs Resolved
Comment thread crates/proxy-client/src/client/udp.rs Resolved
Comment thread crates/proxy-ffi/src/disk_log.rs Resolved
@acking-you
acking-you merged commit 2a3ff9d into dev Oct 17, 2026
4 checks passed
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