moonquic — the QUIC transport for MoonBit (RFC 9000/9001/9002): packets, frames, loss recovery, congestion control, streams and flow control, bytes in and events out. No sockets; the handshake is moontls' and HTTP/3 is moonhttp's.
Dependencies
// A protected packet, from the connection ID up (RFC 9001 §5.2–§5.4).
let (_, server) = @crypto.initial(dcid[:])
let number = @packet.number(1L, None)
let header = long.header(number[:], payload=payload.length() + 16)
let wire = server.seal(header[:], payload[:], number=1L)
// And back, with the packet number recovered against what this space has seen.
let (plain, n) = server.open(wire[:], largest=0L).unwrap()
let frames = @packet.read_payload(plain)moon run examples/02-frames moon run examples/05-ack moon run examples/08-streams
moon run examples/03-params moon run examples/06-flow moon run examples/09-sender
moon run examples/04-crypto moon run examples/07-recovery| Specification | State | |
|---|---|---|
| frame | §19 every frame type, and §19.3.1 the ACK range encoding both ways | 0.1.0 |
| packet | §17 long and short headers, Retry, Version Negotiation, §17.1 packet numbers, §12.3 the three spaces | 0.1.0 |
| crypto | §5 packet protection, header protection and the Retry tag, §6 key update | 0.1.0 |
| recovery | RFC 9002 the round-trip estimate, both loss thresholds, the probe timeout, NewReno and persistent congestion | 0.1.0 |
| stream | §2 stream IDs and reassembly, §3 both state machines, §4 data flow control and the stream quota, and a round-robin scheduler | 0.1.0 |
| conn | §18 transport parameters, §12.3 the three spaces and their CRYPTO streams, and a server's connection table, timers and amplification limit (§8.1, §10, §14.1) | 0.1.0 |
@crypto.initial(dcid[:]) // AEAD_AES_128_GCM, RFC 9001 §5.2
@crypto.initial(dcid[:], suite={ ..@crypto.suite, key: 32 }) // AES-256-GCMInstall
Download zipmoonquic — the QUIC transport for MoonBit (RFC 9000/9001/9002): packets, frames, loss recovery, congestion control, streams and flow control, bytes in and events out. No sockets; the handshake is moontls' and HTTP/3 is moonhttp's.
Dependencies