开源 · BSD-3-Clause · C++17 · RFC 9000 / 9369 / 9114

从 UDP 网卡到 HTTP/3 handler,
全链路自包含的 QUIC 协议栈

生产级健壮,工程级可读。单仓库实现 TLS 1.3、QUIC 传输、HTTP/3 路由与 QPACK 全栈,不依赖任何外部 HTTP 框架;自 1.0 起公开 API 遵循语义化版本。

bash — quicX
$git clone --recurse-submodules github.com/caozhiyi/quicX$cmake -B build -DCMAKE_BUILD_TYPE=Release$cmake --build build --parallel 12$./build/example/hello_world/hello_world_server &hello_world_server listening on 0.0.0.0:7001$./build/example/hello_world/hello_world_client======== Response Received ========Status: 200 Body: hello world$
1523单元与集成测试
90.60%互通通过率(24 场景 × 17 对端)
3份 RFC 完整实现
80,000+行 C++ 代码
18个开箱示例

为什么是 QuicX

生产级健壮

1523 项单元与集成测试,ASan / UBSan / TSan 全绿发布,健壮性经得起生产检验。

互通实证

与 17 个主流 QUIC 实现跑通 24 场景互通矩阵,90.60% 通过——协议正确性有据可查。

工程级可读

网卡 → 加密握手 → 帧编解码 → HTTP/3 逐层贯通,配套 11 站源码阅读路径,排查与二次开发省力。

开箱即用

hello_world、文件传输、server push、压测工具……18 个示例即改即用,CMake / Bazel 双构建。

90.60%24 × 17

互通性,一场景一场景验出来

与 17 个主流 QUIC 实现对跑 24 个场景的互通矩阵——握手、迁移、拥塞控制、连接关闭逐一过关,90.60% 通过率全部留痕可查。

这不是自我声明,是可复现的测试矩阵。

查看互通矩阵 →

单进程 · 五模块

UDP→Packet→Frame→Stream→H3 / QPACK→Handler

请求自上而下:用户 handler → HTTP/3 Connection / QPACK / Router → QUIC Stream 与拥塞控制 → 通用网络与缓冲 → UDP 出网卡。虚线是浏览器收到 Alt-Svc 后的客户端重连跳变。

QuicX module architecture

四行代码,HTTP/3 落地

一个 lambda 就是一个 handler。真实的 hello_world,没有省略任何一行注册代码。

auto server = quicx::IServer::Create();

server->AddHandler(quicx::HttpMethod::kGet, "/hello",
    [](std::shared_ptr<quicx::IRequest> req,
       std::shared_ptr<quicx::IResponse> resp) {
        resp->AppendBody(std::string("hello world"));
        resp->SetStatusCode(200);
    });

server->Init(config);
server->Start("0.0.0.0", 7001);  // HTTP/3 on the wire
git clone --recurse-submodules https://github.com/caozhiyi/quicX.git
cd quicX
cmake -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_EXAMPLES=ON
cmake --build build --parallel $(nproc)
git clone --recurse-submodules https://github.com/caozhiyi/quicX.git
cd quicX

# build every target (library + all 18 examples)
bazel build //...

# run the full unit-test suite
bazel test //test/...

构建产物包含全部 18 个示例,从 example/hello_world 开始。

深入 QuicX