quic_lib 1.2.0
quic_lib: ^1.2.0 copied to clipboard
A pure-Dart QUIC, HTTP/3, WebTransport, and libp2p transport stack.
dart_quic #
A comprehensive, pure-Dart QUIC protocol stack specification and architecture.
Charter #
dart_quic is a pure-Dart implementation of QUIC (RFC 9000), HTTP/3 (RFC 9114),
WebTransport (RFC 9220), and libp2p QUIC transport. The codebase is fully
implemented with comprehensive tests and security hardening.
Scope #
- QUIC transport (RFC 9000, RFC 9001, RFC 9002) — wire encoding, packet protection, handshake, streams, flow control, congestion control.
- HTTP/3 (RFC 9114) — mapping HTTP semantics onto QUIC.
- WebTransport (draft-ietf-webtrans-http3) — datagrams, bidirectional and unidirectional streams.
- libp2p QUIC integration — multiaddr formats, security handshake (TLS 1.3 with embedded peer public key), stream mapping.
- Dart-native API design —
dart:iointegration,Stream/Futureidioms,dart:ffiavoidance, zero native dependencies.
Document Structure #
| Directory | Contents |
|---|---|
doc/specs/ |
Formal specifications for each subsystem (21 files). |
doc/research/ |
Consolidated RFC summaries and prior-art analysis (1 file). |
doc/architecture/ |
Module design, data flow, API surface (5 files). |
Status #
Version 1.2.0 — Full implementation with 1,685 passing tests across QUIC wire format, crypto, connection management, recovery, HTTP/3, WebTransport, and libp2p transport. See CHANGELOG.md and SECURITY_FIXES.md for the latest updates.
Installation #
Add dart_quic to your pubspec.yaml:
dependencies:
dart_quic: ^1.2.0
Requires Dart SDK ^3.0.0.
Quickstart #
import 'package:dart_quic/dart_quic.dart';
void main() async {
// Create a QUIC endpoint bound to a local address.
final endpoint = await QuicEndpoint.bind(InternetAddress.anyIPv4, 0);
// Connect to a remote peer.
final connection = await endpoint.connect(
InternetAddress.loopbackIPv4,
4433,
);
// Open a bidirectional stream and send data.
final stream = connection.openBidirectionalStream();
stream.write(Uint8List.fromList([1, 2, 3]));
await stream.done;
// Clean up.
connection.close();
endpoint.close();
}
See example/echo_client.dart and example/echo_server.dart for complete examples.
Testing #
Run the full test suite:
dart test
Run with coverage:
dart test --coverage=coverage
dart run coverage:format_coverage --in=coverage --out=coverage/lcov.info --lcov
Contributing #
Contributions are welcome. Please read the architecture overview in ARCHITECTURE.md and security guidelines in SECURITY.md before submitting changes. All PRs must pass:
dart analyze— zero issues.dart test— all tests green.dart format --set-exit-if-changed— formatting clean.
License #
MIT — see LICENSE.