msquic
Copilot instructions4.8k starsChanged 7 months agoMITView on GitHub
MsQuic is Microsoft's cross-platform C implementation of the IETF QUIC protocol. It also has C++ API wrappers and Rust/C# interop layers. The codebase targets Windows (user & kernel mode), Linux, macOS, and FreeBSD. The primary language is C (C17), with C++ (C17) for tests/tools, Rust bindings, and C# interop. Build system: CMake + PowerShell scripts. Key files: CMakeLists.txt (root build), version.json (version info), .clang-format (C/C++ style), src/.editorconfig (editor settings), Cargo.toml (Rust crate config), rust-toolchain.toml (Rust 1.93.1). Always use PowerShell 7+…
Trending
Quiet this year.about the whole repository
Who's talking about microsoft/msquic
- A Hacker News story“MsQuic – QUIC Implementation from Microsoft”Hacker News · Apr 29, 2020 · 153 points
- oven-sh/bun“[Feature Request] Add support for QUIC.”GitHub · Oct 10, 2024 · 34 reactions
- A Hacker News story“MsQuic: Cross-Platform QUIC Library”Hacker News · Sep 21, 2021 · 12 points
- Mbed-TLS/mbedtls“Expose QUIC API”GitHub · Jun 25, 2021 · 12 reactions
- ninenines/cowboy“QUIC and HTTP/3”GitHub · Nov 2, 2021 · 10 reactions
The biggest 5 of 27 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 27
Talked about on GitHub and Hacker News (27 times).
On GitHub · 22
- Oct 10, 2024[Feature Request] Add support for QUIC. — oven-sh/bun34 reactions · 5 comments
- Jun 25, 2021Expose QUIC API — Mbed-TLS/mbedtls12 reactions · 24 comments
- Nov 2, 2021QUIC and HTTP/3 — ninenines/cowboy10 reactions · 24 comments
- Apr 15, 2024[API Proposal]: Add sendmmsg and recvmmsg to Socket for Linux — dotnet/runtime7 reactions · 2 comments
- Aug 9, 2023[API Proposal]: QUIC stream priority support — dotnet/runtime6 reactions · 17 comments
17 more on GitHub
- Sep 17, 2025QUIC / HTTP3 support — pingooio/pingoo4 reactions · 2 comments
- Jul 2, 2025Implement spurious loss recovery — quinn-rs/quinn4 reactions · 6 comments
- Nov 24, 2023Question: any thoughts on reliable UDP or QUIC? And QoS? — Cysharp/MagicOnion4 reactions · 6 comments
- Feb 9, 2022Add QUIC (or HTTP/3) support — vpnhood/VpnHood4 reactions · 27 comments
- May 20, 2025Upgrade to msquic 2.5 — emqx/quic3 reactions · 8 comments
- Feb 8, 2023Quic should support OpenSSL 3.x — dotnet/runtime3 reactions · 3 comments
- Feb 10, 2022Build fails in NixOS — emqx/quic3 reactions · 5 comments
- Feb 2, 2022Create Artifact Container - Attempt 5 of 5 failed with error: connect ETIMEDOUT — actions/upload-artifact3 reactions · 7 comments
- Jun 5, 2025Performance issue on internet — quinn-rs/quinn2 reactions · 29 comments
- Jun 16, 2023Windows ASAN Build Regression in 20230612.1 — actions/runner-images2 reactions · 12 comments
- Mar 11, 2022Installing Driver Hangs on Windows 2022 [Regression in Last 24-Hours] — actions/runner-images2 reactions · 2 comments
- May 31, 2021QUIC: update status codes for unix platforms — dotnet/runtime2 reactions · 1 comment
- Nov 12, 2025Enable OpenSUSE Dockerfile — dotnet/dotnet-buildtools-prereqs-docker1 reaction
- Oct 22, 2025Port numasupport to remove lib dependency — microsoft/cxplat1 reaction · 7 comments
- Dec 12, 2024Use of test APIs — nibanks/msh31 reaction · 15 comments
- Jan 20, 2022Implement an egress-policy: warn-only mode — step-security/harden-runner1 reaction · 1 comment
- Feb 13, 2021While debugging a test failure with stub tls, we realized that loopback connections have increased potential for out of order packet receives. This manifested as a failure for stub tls, and a potential performance issue for proper TLS providers. — Anas198900/waledzaad1 reaction
On Hacker News · 5
- Apr 29, 2020MsQuic – QUIC Implementation from Microsoft153 points · 84 comments
- Sep 21, 2021MsQuic: Cross-Platform QUIC Library12 points
- Jul 24, 2023Msquic: Cross-platform C implementation of QUIC protocol for C, C++, C#, Rust2 points · 1 comment
- Apr 30, 2020MsQuic2 points
- May 4, 2020Msquic: Cross platform C implementation of the IETF QUIC protocol1 point
In this repository2 other files it gives its agents.
The file
We split this copilot-instructions.md into the rules it gives an agent
7 rules. About 0 are common, 2 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 33
Always use PowerShell 7+ (pwsh).
- Very specific: line 90
If you add or modify trace/log calls (macros like QuicTraceLogInfo, QuicTraceEvent, etc.), you must regenerate the CLOG sidecar:
- Very specific: line 124
Test infrastructure uses GoogleTest.
- Very specific: line 128
QUIC_API_ENABLE_PREVIEW_FEATURES: Always defined to 1 in src/core/precomp.h. - Very specific: line 132
When creating pull requests, always follow the PR template at .github/pull_request_template.md.
- Distinctive: line 133
If asked to fix a specific issue, mention the issue number in the PR description (e.g.
- Distinctive: line 141
Follow these instructions as the primary reference.
≈ “Common” is an estimate: at least 1 in 5 of the 1,644 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Copilot Instructions for MsQuic
Project Overview
MsQuic is Microsoft's cross-platform C implementation of the IETF QUIC protocol. It also has C++ API wrappers and Rust/C# interop layers. The codebase targets Windows (user & kernel mode), Linux, macOS, and FreeBSD. The primary language is C (C17), with C++ (C17) for tests/tools, Rust bindings, and C# interop. Build system: CMake + PowerShell scripts.
Repository Layout
| Path | Description |
src/core/ | Platform-independent QUIC protocol logic (connections, streams, loss detection, congestion control) |
src/platform/ | Platform abstraction layer: sockets/datapath, TLS (schannel/openssl), crypto, OS primitives |
src/inc/ | Public and internal headers. msquic.h is the public C API. msquic.hpp is the C++ wrapper. |
src/bin/ | Packages static libs into platform-specific shared/static binaries |
src/test/lib/ | Test implementations (GoogleTest-based): ApiTest.cpp, HandshakeTest.cpp, etc. |
src/test/bin/ | Test runner executable (quic_gtest.cpp) |
src/tools/ | Utilities: sample/, spin/, attack/, interop/, perf tools (secnetperf) |
src/perf/ | Performance test library and tools |
src/generated/ | Auto-generated CLOG tracing files. Do not edit manually — regenerate with scripts/update-sidecar.ps1 |
src/rs/ | Rust bindings (lib.rs, types.rs, config.rs, etc.) |
src/cs/ | C# interop layer |
src/manifest/ | Windows ETW manifest and CLOG config (clog.sidecar, msquic.clog_config) |
scripts/ | PowerShell build/test/CI scripts (cross-platform via pwsh) |
docs/ | Documentation: BUILD.md, TEST.md, API.md, Architecture.md, etc. |
submodules/ | Git submodules: googletest, quictls, openssl, clog, xdp-for-windows |
cmake/ | CMake helper modules and toolchain files |
.github/workflows/ | CI workflows: build.yml, test.yml, cargo.yml, check-clog.yml, check-dotnet.yml |
Key files: CMakeLists.txt (root build), version.json (version info), .clang-format (C/C++ style), src/.editorconfig (editor settings), Cargo.toml (Rust crate config), rust-toolchain.toml (Rust 1.93.1).
Building (Windows)
Always use PowerShell 7+ (pwsh). All scripts are in scripts/.
Prerequisites: Visual Studio 2022 with C++ workload, CMake ≥ 3.20, Windows SDK 10.0.26100.0+, .NET SDK (see global.json). Submodules must be initialized: git submodule update --init.
First-time setup:
./scripts/prepare-machine.ps1 -ForBuildBuild with schannel (default on Windows, no extra dependencies):
./scripts/build.ps1Build with openssl/quictls (requires Perl + NASM installed):
./scripts/build.ps1 -Tls opensslKey build flags: -Config Debug|Release (default: Debug), -Arch x86|x64|arm64 (default: x64), -Tls schannel|openssl|quictls, -Clean (clean rebuild), -DisableTest, -DisableTools, -DisablePerf, -Static.
Build output: artifacts/bin/<platform>/<arch>_<config>_<tls>/ for binaries; build/<platform>/<arch>_<tls>/ for CMake intermediates.
Important: Building with -Tls openssl on Windows requires Strawberry Perl and NASM. If you get 'perl' is not recognized, install Perl or use -Tls schannel instead.
Building (Linux)
pwsh ./scripts/prepare-machine.ps1 -ForBuild
pwsh ./scripts/build.ps1 -Tls opensslTesting
Build first, then:
./scripts/prepare-machine.ps1 -ForTest
./scripts/test.ps1 -Tls schannel # Windows
./scripts/test.ps1 -Tls openssl # Linux or Windows+OpenSSL
./scripts/test.ps1 -Filter 'SomeTest.*' # Run subset via GoogleTest filterTests are GoogleTest-based. Three test binaries: msquicplatformtest, msquiccoretest, msquictest. Tests should be run in a VM or dedicated machine — some tests require admin/root, test signing, or network configuration.
Rust
cargo build # Builds C library from source + Rust bindings
cargo test # Runs Rust tests
cargo fmt --all -- --check # Format check (CI enforced)
cargo clippy --all-targets -- -D warnings # Lint (CI enforced)Rust toolchain version is pinned in rust-toolchain.toml (1.93.1).
CLOG Tracing (Critical for Trace Changes)
If you add or modify trace/log calls (macros like QuicTraceLogInfo, QuicTraceEvent, etc.), you must regenerate the CLOG sidecar:
./scripts/update-sidecar.ps1This updates files under src/generated/. Commit the regenerated files with your change. The check-clog.yml CI workflow validates this — it will fail if generated files are stale.
Similarly, if you change the C API surface (header files in src/inc/), run:
./scripts/generate-dotnet.ps1The check-dotnet.yml CI workflow validates the generated .NET interop files are up to date.
CI Workflows (Run on Every PR)
| Workflow | What it checks |
build.yml | 200+ build configurations across Windows/Linux/macOS, multiple TLS providers, architectures |
test.yml | BVT (Build Verification Tests) across platforms |
cargo.yml | Rust build, cargo fmt, cargo clippy, cargo test, binding freshness check |
check-clog.yml | CLOG sidecar is up to date (runs update-sidecar.ps1 and checks for diffs) |
check-dotnet.yml | .NET generated files are up to date (runs generate-dotnet.ps1 and checks for diffs) |
Code Style
- C/C++: 4-space indent, no tabs, 100-column limit. Braces on next line for functions, same line for control flow. Use
QUIC_prefix for macros/types. Stay consistent with existing code. - Rust: Standard
rustfmtformatting. CI enforcescargo fmt --check. - Editor settings: See
src/.editorconfig— 4-space indent, trim trailing whitespace, final newline. - C++ files use
.cpp/.hextensions. C files use.c/.h.
Architecture Notes
- Two main layers: QUIC (protocol, in
src/core/) and Platform (OS abstraction, insrc/platform/). - Platform layer abstracts: TLS (
tls_schannel.c,tls_openssl.c,tls_quictls.c), UDP sockets/datapath (datapath_win.c,datapath_epoll.c,datapath_kqueue.c), crypto (crypt_bcrypt.c,crypt_openssl.c). - Public API is in
src/inc/msquic.h. C++ wrapper insrc/inc/msquic.hpp. - Test infrastructure uses GoogleTest. Test cases in
src/test/lib/, runner insrc/test/bin/.
Coding Conventions
QUIC_API_ENABLE_PREVIEW_FEATURES: Always defined to1insrc/core/precomp.h. Do not use#ifdef QUIC_API_ENABLE_PREVIEW_FEATURESguards insrc/core/orsrc/platform/code — the guard is only needed insrc/inc/msquic.hto identify preview API surface and make it easy to avoid using preview features by mistake.
Pull Requests
When creating pull requests, always follow the PR template at .github/pull_request_template.md.
If asked to fix a specific issue, mention the issue number in the PR description (e.g. "Fixes #1234").
Update These Instructions
As you learn the codebase, update this file with any important information you think would help future contributors. This is the primary source of truth for how to work with the codebase, so keep it accurate and comprehensive.
Trust These Instructions
Follow these instructions as the primary reference. Only search the codebase if the information here is incomplete or found to be incorrect for your specific task.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

