Skip to content

feat: 完整实现 Naive/Cronet H2、H3 与 UoT v2 出站#39

Open
MiChongs wants to merge 2 commits into
mainfrom
agent/protocol-naive-suite
Open

feat: 完整实现 Naive/Cronet H2、H3 与 UoT v2 出站#39
MiChongs wants to merge 2 commits into
mainfrom
agent/protocol-naive-suite

Conversation

@MiChongs

Copy link
Copy Markdown
Owner

变更概述

本 PR 基于最新 origin/main4eccc5b)在独立 git worktree 中实现完整的 Naive 协议族支持。实现使用已发布的 cronet 0.2.0,并参照 sing-box 当前最新开发分支的 Naive 出站与 UDP over TCP v2 行为。

实现内容

  • 新增 naivenaive+httpsnaive+quic 节点与 URI 解析。
  • 新增基于 SagerNet/Naive Cronet 的 H2/H3 CONNECT 出站。
  • 支持 Basic 认证、自定义请求头、H2 非安全并发连接池。
  • 实现 Naive 前 8 个数据块的填充编码与解码。
  • 实现 sing-box UoT v2 定目标 UDP 封装和严格帧边界处理。
  • 支持 QUIC 拥塞控制、流/会话接收窗口、SNI、自定义根证书和 ECH。
  • Cronet 自定义 TCP/UDP/DNS 钩子接入内核现有 socket protect、mark 和 bind-interface 路径。
  • 补齐 Clash/Mihomo 订阅中的 usernameextra-headers 与 Naive 参数映射。
  • 新增可选 naive Cargo feature,并由 wuther-core 透传。
  • 新增独立 Naive CI,下载并校验固定版本 Cronet SDK 后执行原生隧道测试。
  • 新增中文构建、配置、动态库部署和许可文档。

兼容性与许可

Naive 保持为显式启用的可选 feature。默认 MIT 构建和默认 Release 不包含 Cronet 动态库;启用或分发 Naive 构建时,需要遵守 cronet 与 SagerNet/Naive Cronet 的 GPL-3.0-or-later 要求。

Cronet 不提供可靠的跳过证书验证能力,因此 insecure / skip-cert-verify 会被明确拒绝;私有 CA 通过 certificatecertificate-path 配置。

验证

  • cargo fmt --all --check
  • python scripts/check-repository.py
  • cargo test --workspace --locked
  • cargo check -p wuther-core --features naive --all-targets --locked
  • cargo test -p core-outbound --features naive naive --locked
  • 原生 Cronet H2 CONNECT + TLS + Naive 填充回环测试
  • UoT v2 编码、跨目标拒绝、超长数据报丢弃与后续帧恢复测试
  • Naive URI、Clash/Mihomo 订阅、注册表和 ECH Config List 回归测试

@MiChongs
MiChongs marked this pull request as ready for review July 25, 2026 20:28
@MiChongs

Copy link
Copy Markdown
Owner Author

@copilot resolve the merge conflicts in this pull request

@MiChongs
MiChongs enabled auto-merge (squash) July 25, 2026 20:29
…suite

# Conflicts:
#	Cargo.lock
#	Cargo.toml
#	crates/core-config/src/node_uri.rs
auto-merge was automatically disabled July 25, 2026 20:33

Head branch was pushed to by a user without write access

Copilot AI commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts in this pull request

Merge conflicts have been resolved in commit 81d71a1. The three conflicting files were:

  • Cargo.toml: Kept hickory-proto = "0.26" (Naive feature) and added the system-config feature to hickory-resolver (from main).
  • crates/core-config/src/node_uri.rs: Three conflict sites resolved — TLS protocol match arms now include both Naive and Young; both scheme_is_naive_quic and validate_young_certificate_pin helper functions are retained; and all test functions from both branches are preserved.
  • Cargo.lock: Regenerated via cargo generate-lockfile after the above changes.

@MiChongs
MiChongs enabled auto-merge (squash) July 25, 2026 20:33
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