Repository navigation
fix(tun): preserve Windows UDP process-bypass mappings - #61
Merged
Merged
Conversation
acking-you
marked this pull request as ready for review
October 28, 2026 16:16
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.
Windows TUN 按进程绕过时,原先每个 UDP 目标分别创建物理 socket,导致同一应用源端点访问 STUN 与 P2P 对端时源端口不同。本 PR 引入按应用源端点复用的 UDP 映射,并更新实际行为与边界说明。
Closes #58
变更
deps/tun2proxy固定到已合并的 tun2proxy #15 默认分支提交c403d02a697cfbd00690edab6c650cec8e8690c5。已确认 squash 提交的 tree 与通过验证的 PR 头9457d20完全一致。兼容性
无加密线协议、C FFI ABI、Flutter 源码或依赖版本变化。仅 Windows 进程绕过的非 DNS 单播 UDP 使用共享映射;其他路径保持既有处理。
PID+绑定时间是尽力而为的指纹,同进程同端口快速重绑可能不可区分。初始归属不明确时使用原有隔离路径;建立期间归属变化或无法复核时拒绝新流,避免沿用不确定进程的绕过权限。物理映射可保留 120 秒,但回复仅投递到仍活跃的目标流。
验证
固定 Rust nightly-2026-10-26,Windows x64:
http_proxy.dll、wintun.dll、Flutter 运行库、插件及辅助程序。构建、暂存及 bundle 中的原生 DLL SHA-256 一致:6649B08DF16CEC14781041046A0587EFA624B3C39D68833C4776CAFCD81E85AF。手机公网 P2P 尚未复测;本机源端口稳定不代表所有 NAT 环境都能直连。