* chore: download latest official mihomo for interop tests * test: capture N0 baseline and protocol feasibility probes * docs: record N0 hybrid REALITY fork verification * test: verify N0 controlled Hysteria2 auth and streams Add an isolated Quinn adapter over existing DIRECT and SOCKS5 datagrams, bounded queues, protect rejection probes, and official latest peer fixtures. Record passing auth/TCP checks and the native Hysteria half-close failure separately. N0 remains incomplete; production sources and dependency locks are unchanged. * test: validate N0 native QUIC hopping and XHTTP H3 Keep the probes isolated from production. Verify one-state Hysteria hopping, protected rebind rejection, Xray H3 entry and existing HY2 regressions. Set only the owned Linux peer MTU to avoid Initial-packet EMSGSIZE; retain native half-close failures as separate gates. * fix: align XHTTP shutdown with Mihomo connection close * test: verify N0 supplied-stream transport interfaces Add isolated TLS, ordinary WebSocket and gRPC probes with owned I/O, bounded buffers and cancellation barriers. Match Mihomo close behavior: preserve TLS/WS reads, distinguish clean WS underlay EOF from truncation, and close both gRPC directions. Use separate official SOCKS5 peers to avoid fixture loop detection. Record 12 Debug/Release tests, 42 official Mihomo checks, dependency audits and Apple/Android compile checks. Keep production dependencies, third-party sources and remaining N0 gates unchanged. * fix: upgrade h2 and retain completed responses after reset * chore: use the current OneXray rustls fork origin * chore: adopt published rustls 0.23.45 and official TLS binding * chore: refresh N1 foundation and spike dependencies * feat: validate next-protocol field and combination catalogs * feat: share immutable TLS policies and bounded close semantics * feat: add shared stream transports and decouple XUDP framing * feat: add controlled datagram foundations and N1 acceptance harness * chore: finalize N1 with verified x25519 dependency * chore: publish N1 against the rustls release branch * feat: add bounded Trojan request and datagram codecs * feat: connect Trojan TLS TCP and UDP through the runtime * feat: support Trojan WebSocket and duplex gRPC transports * feat: enable Trojan and complete N2 consumer acceptance * feat(vmess): add bounded AEAD header and body codecs * fix(vmess): align close acceptance with Mihomo transports * feat(vmess): add UDP codecs and isolated peer comparisons * feat(vmess): complete public runtime and N3 acceptance * docs: bind N3 acceptance and refresh validation guidance * feat(vless): complete N4 transports, Vision and UDP support Extract VLESS assembly, add plain/TLS stream transports, HTTPUpgrade, node-owned gRPC pooling, mTLS and classic REALITY, and implement Vision through public TLS record boundaries. Preserve XHTTP and the XUDP default while adding raw and packetaddr. Complete 145 required groups and 39 field rows against isolated latest official peers, with 160 lifecycle/resource rounds, independent coverage and Apple/Android release builds. Preserve the three explicit WS/REALITY layered close comparisons and historical failures in the acceptance report. No third-party or dependency-lock changes. * feat(vless): complete N5 XHTTP and sing-mux support Add H1/H2/H3 request fields, independent download security and pools, bounded packet-up batching, and h2mux/smux/yamux over controlled transports. Keep Mihomo-aligned close and path semantics, node-owned shutdown barriers, and isolated official-peer fixtures including the approved Caddy mTLS gateway. Validate 416 required groups, 57 fields, 112 two-leg security checks, 240 lifecycle/resource cycles, independent coverage, and Apple/Android release builds. Record native-peer gaps and leave N6-N10, devices, CI, and release gates separate. * feat: integrate boring TLS profiles and retire rustls fork * test(tls): freeze selected fingerprint reference baseline * docs(tls): record selected-profile library acceptance * feat(tls): integrate selected client fingerprints and REALITY profiles * feat(tls): complete selected fingerprint CF5 acceptance * feat(hysteria2): complete N6 client support and acceptance Implement Hysteria2 over official Quinn/h3/rustls and shared controlled IO, including TCP/UDP, bandwidth pacing, Salamander, port hopping, upstream snapshots and synchronous Stop. Keep old-path receives active for the full bounded handover window, preserve independent reader wakeups, and require the exact nested TCP evidence assertions. Validate one frozen N6 run: 36 required groups, 20 field rows, native Mihomo/Hysteria peers, H3 regression, 40 lifecycle rounds and Apple/Android production builds. Record independent coverage, artifact hashes and native-peer limitations. * test(tls): record N7 hybrid REALITY prerequisite evidence Preserve the locked classic-only API failure and distinguish the locally accepted boring hybrid extension from pending VCore S03/D16 integration. Record wrapper feasibility and publication boundaries without changing production configuration or dependencies. * feat(vless): support explicitly required hybrid REALITY * feat(crypto): wrap official BLAKE3 binary-context derivation * feat(vless): implement authenticated Encryption wire transport * feat(vless): enable authenticated Encryption across public transports * build(tls): pin the authenticated ShadowTLS ClientHello hook * feat(vless): add authenticated JLS transport security Pin the separately approved boring JLS revision and expose strict main/download credentials under schema 24. Preserve native CertificateVerify and Finished, cancellation, and controlled IO ownership. Accept the JLS field slice with 122 isolated cases, 80 lifecycle/resource cycles, and Apple/Android release libraries; keep broader N7 gates separate. * docs(n7): reconcile current JLS acceptance progress * chore(vless): retire Restls while retaining JLS * feat(vless): complete N7 static ECH and security combinations Add static ECH for VLESS main and XHTTP download legs using existing TLS backends and official Rust HPKE. Keep Invoke v5 and advance the internal schema to revision 27. Accept the narrowed N7 scope with 43 required groups, 11 fields, 301 isolated native cases, 240 lifecycle/resource rounds, and Apple/Android release builds. Record frozen inputs, 470 container cleanups, explicit upstream comparison gaps, and prior failed runs in docs/acceptance/next-protocols/N7.md. * chore(protocols): retire WireGuard scope and foundations * test: complete N9 protocol integration and resource gates * build: add N10 production artifact evidence gates * fix: restore Windows snapshot encoding and fail-closed delivery CI * fix: use native ARM64 LLVM assembly and scoped delivery CI * build: keep delivery lockfile bytes stable across platforms * fix: preserve production guard lifecycle and isolate CI feature checks * build: adopt released boring and registry shadowsocks * ci: use release-oriented workflow names * docs: consolidate contracts and streamline test tooling Merge current protocol and platform contracts, remove milestone reports and obsolete spikes, and share core checks between local development and CI. Preserve all 884 executable case definitions and unique legacy assertions. Validation: core Debug/Release, feature checks, Clippy, netstack, offline script tests, formatting and documentation links passed locally. Container interop smoke attempts failed during official peer downloads; business paths remain NOT RUN. * test: replace milestone names with capability-based validation Rename protocol and fingerprint suites, fixtures, and evidence identifiers by capability. Preserve acceptance cases and golden wire data while documenting reference, wire, and interoperability evidence separately. * fix: address review findings and stabilize core CI Flush accepted gRPC/H2 data through the supplied IO before reset, and wait for pending smux writes before FIN. Sanitize AnyTLS peer failures, reject XHTTP userinfo, and remove stale Android delivery artifacts. Close container log capture even when inventory fails. Keep legacy host suites blocked before resource acquisition. Separate Shadowsocks adapter codec checks from upstream strict server acceptance. Lock the random empty-request zero-padding failure with deterministic negative and positive fixtures, without changing the dependency or production behavior. * test: isolate delivery fixture from Windows home lookup * test: preserve UDP socket semantics during peer teardown The memory peer treated its counterpart closing an mpsc channel as a local UDP BrokenPipe. That could terminate Quinn endpoint IO without waking a pending wait_idle, despite all four datagrams and CONNECTION_CLOSE having arrived. Keep a closed peer link silent and late sends best-effort, add a deterministic fixture regression, and preserve the existing data and shutdown deadlines. Debug/Release, Clippy, and 300 consecutive regression iterations pass. * fix: drain XHTTP uploads before releasing connection drivers * fix: enforce lazy setup deadlines and safe delivery paths Check the original deadline before accepting ready gRPC/H2 headers or sing-mux status, without limiting established reads. Reject symlinks and Windows reparse points in every delivery output path before filesystem mutations. Add deterministic memory and temporary-filesystem regressions. * test: join XHTTP H3 peer tasks during cleanup Quinn retains closed connections for three probe timeouts, so a delayed handshake can legitimately exceed the fixture's two-second wait_idle budget. Own, abort, and join the passive peer tasks after upload and client shutdown instead. Preserve upload integrity and client close bounds, and cover delayed handshakes in both streaming modes.
VCore
VCore is a standalone, host-agnostic Rust client proxy core. It provides proxy graphs, static select proxy groups, DNS, routing rules, GeoData, HTTP/SOCKS5 listeners, a TUN data plane, and a loopback Controller through strict YAML configuration and Invoke API v5. The internal configuration schema revision is 27; the revision appears only in the version response and buildIdentity, not in YAML.
Features
- Outbounds: VLESS TCP/WS/gRPC/HTTP/H2/XHTTP, TLS/REALITY and Vision, SOCKS5 CONNECT/UDP ASSOCIATE, AnyTLS TCP/UoT, Shadowsocks 2022, Trojan TCP/UDP over TLS/WS/gRPC, VMess AEAD over TCP/WS/gRPC/HTTP/H2, Hysteria2 TCP/UDP, bandwidth, Salamander and port hopping, and DIRECT. SS supports three standard 2022 algorithms and AES identity chains; see its upstream risks and acceptance boundaries.
- Proxy chains:
dialer-proxyforms a directed acyclic graph of arbitrary length. If node A points to B, the physical path isclient -> B -> A -> target. - Proxy groups: static
selectgroups keep ordered members, including concrete nodes, nested groups,DIRECT, andREJECT; their current-session selection can be changed live through the Controller.dialer-proxymay reference nodes or groups; DIRECT in an upstream group connects the current node's prepared server. - Routing: ordered
DOMAIN,DOMAIN-SUFFIX,DOMAIN-KEYWORD,GEOSITE,GEOIP,IP-CIDR,IP-CIDR6,DST-PORT,NETWORK, and finalMATCHrules. - DNS: fixed-IP UDP/TCP nameservers, explicit outbounds, ordered policy/failover, typed and opaque caches, singleflight, and TUN UDP/TCP port 53 interception.
- TUN: raw IPv4/IPv6, TCP/UDP, local ICMPv4/ICMPv6 Echo replies, HTTP/TLS/QUIC sniffing, and four per-session traffic counters.
- Listeners: HTTP CONNECT/forward with per-request authentication/routing, streaming bodies, Keep-Alive and Upgrade; SOCKS5 CONNECT and TCP-authorized UDP ASSOCIATE. Local access is unauthenticated by default; opt-in LAN sharing requires one shared username/password.
- GeoData: VCore manages
geosite.datandgeoip.datunderdataDir/geodata, loads them on demand, and can update them through a proxy chain. - Delay measurement:
measureDelayaccepts 1–5 node-only configurations per call, uses up to five private workers, and preserves input order in its results. - TLS: independent certificate pins and four opt-in ClientHello templates (Chrome120/133, Firefox120, Safari16.0) over TCP TLS/REALITY/JLS; see public names, scope and limitations. VLESS JLS uses separate shared credentials with complete native TLS authentication. Static ECH uses explicit VLESS main/download-leg configuration with no dynamic DNS lookup or fallback.
Configuration
docs/config.yaml is the only complete example. Key constraints:
- YAML is limited to 256 KiB and rejects unknown fields, anchors, aliases, custom tags, and obsolete structures.
- The top level must contain at least one proxy and an enabled
port,socks-port, ortun. - Proxy and group definition names share one exact, case-sensitive namespace. Names are 1–64 UTF-8 bytes, reject surrounding Unicode whitespace, controls,
, # / ? & = % \,.and.., and reserveDIRECT,REJECT, andRULES; internal ordinary spaces, CJK, and emoji are allowed. proxy-groupsaccepts onlyselect. Member order and duplicates are preserved; an omitteddefault-selectedselects the first member, while an explicit value must name a direct member. All node upstreams and group members, including unselected members, must form one acyclic graph.rulesis required and must end with exactly oneMATCHtargeting a configured proxy node or proxy group.DIRECTandREJECTare built-in actions and group members; every other route target must be a configured proxy node or proxy group. DNS alone also reservesRULES.- Configuration is delivered inline through
configYaml/configYamls; VCore does not read host configuration paths. - Runtime values such as the Controller, TUN fd, Controller port, and secret are generated by the host and are not stored in user RAW YAML.
Lifecycle and ABI
Cross-platform entry points:
char *VCoreInvoke(const char *request_json);
void VCoreFree(char *response);
Windows packages also use the revision-3 host bridge for the all-app VPN policy, profiles, Session Snapshots, and the optional session backend:
char *VCoreWindowsVpnInvoke(const char *request_json);
The public runtime has one instance:
initialize
-> createInstance
-> prepare(configYaml)
-> start
-> stop
-> destroyInstance
instanceId is a generation token that is never reused by the current runtime. Commands for the same instance fail fast when another command is active; pure validateConfig calls may run concurrently. See docs/invoke-api.md for the complete envelope, methods, fd ownership, and Android protect contract.
Runtime state is exposed through a session-local loopback Controller:
GET /traffic
GET /group
GET /group/{name}
GET /proxies/{name}
PUT /proxies/{name}
Authorization: Bearer <secret>
GET /traffic is a one-time up/down/upTotal/downTotal TUN snapshot. The group endpoints expose and change the selected direct member of static select groups; a successful change affects only new physical TCP, UDP, and DNS transports in the current session. It does not migrate existing connections, UDP associations, DNS state, or pooled TCP transports, and it never performs automatic failover. A Controller that manages groups requires one Bearer secret for all routes and may run without TUN. See docs/controller-api.md.
An authenticated Hysteria2 session keeps its upstream selection during port hopping. A replacement socket for that same QUIC session does not resample the group; only a new authenticated session does.
Platforms
| Platform | Data plane | Status |
|---|---|---|
| iOS / macOS | The host provides a utun fd; VCore duplicates it and uses a synchronous rust-tun device with Tokio AsyncFd |
Implemented; the release iOS device footprint remains a release gate |
| Android | VpnService provides a raw-IP fd; every outbound socket must pass the protect callback first |
Implemented; the physical-device matrix remains a release gate |
| Windows | Windows.Networking.Vpn AppContainer Provider plus one full-trust runtime per session; package-local named pipes carry raw IP |
A development-signed Windows 11 ARM64 package passed functionality, lifecycle, pressure, and bounded-batching acceptance |
| Linux | — | Unsupported; startup fails closed |
Windows does not use an fd emulation layer. The Provider owns only VpnChannel, buffers, routes, physical-network monitoring, the packet gateway, and fail-closed Stop. The complete VCore runtime, Controller, DNS, rules, and outbounds live in the Session Host. The packet channel keeps protocol-v1 framing and batches at most eight already-ready frames without waiting for future packets.
Resource Bounds
Safety is enforced through per-object queues, buffers, parser limits, deadlines and owned cancellation, not a global business-flow quota. See the resource policy for shared limits and protocol-specific contracts for local budgets. Memory telemetry does not change lifecycle results.
Documentation
Example
- Minimal Windows UWP VPN integration: a same-package Provider, Session Host, full-trust foreground host, MSIX manifest, and runnable command-line demo.
Validation
cargo fmt --all -- --check
uv run --project scripts --locked vcore-scripts check core --profile debug
cargo clippy --locked --all-features --lib --bins -- -D warnings
cargo test --manifest-path crates/vcore-netstack/Cargo.toml --all-targets
cargo clippy --manifest-path crates/vcore-netstack/Cargo.toml --all-targets -- -D warnings
uv run --project scripts --locked vcore-scripts check c-header
uv run --project scripts --locked vcore-scripts check tls-dependencies
uv run --project scripts --locked python -m unittest discover -s scripts/tests
uv run --project scripts --locked ruff check scripts
uv run --project scripts --locked ruff format --check scripts
Platform artifacts (see scripts/README.md for complete commands and environment variables):
uv run --project scripts --locked vcore-scripts build apple
uv run --project scripts --locked vcore-scripts build android
uv run --project scripts --locked vcore-scripts build windows
See docs/acceptance.md for the current validated scope and deferred physical-device and Windows release gates.
Credits
VCore's dependencies, maintained forks, public API/protocol references, architectural references, and interoperability counterparts include:
- smoltcp, clash-rs, and netstack-smoltcp: userspace IP stacks and TUN netstacks.
- windows-rs, UWP VPN Plugin Sample, wireguard-uwp-rs, Maple, and YtFlowCore: Windows VPN, WinRT activation, and packet flow.
- Xray-core, Mihomo, and Leaf: proxy protocols, routing, TUN architecture, and interoperability references.
- rustls: unprofiled TLS/QUIC and shared WebPKI certificate policy.
- boring and BoringSSL: upstreams of the maintained fork for named ClientHello profiles and classic / opt-in hybrid REALITY.
- shadowsocks-rust: the unmodified SS 2022 protocol dependency and source of the derived UDP replay window; see the MIT notices in the source header.
License
VCore is licensed under the MIT License.