Package io.github.mahmoudimus.quic
package io.github.mahmoudimus.quic
A dependency-free QUIC transport (RFC 9000, 9001, 9002, 9221, 9369). This package holds the
shared primitives (
VarInt, ConnectionId, QuicVersion, ...) and
the blocking API built for virtual threads: QuicServer and
QuicClient own a UDP socket each, and hand out QuicConnections whose QuicStreams
are read and written as InputStreams and OutputStreams.
The protocol itself is sans-I/O, in io.github.mahmoudimus.quic.connection: the I/O
layer here only moves datagrams and wakes connections up.
-
ClassDescriptionThe TLS 1.3 cipher suites QUIC can use (RFC 9001 section 5.3), with what packet protection needs to know about each: its HKDF hash, AEAD and key length.A QUIC connection ID (RFC 9000 section 5.1): 0 to 20 opaque bytes with value semantics.The four QUIC encryption levels (RFC 9001 section 4), each with its own keys.What a QUIC endpoint answered itself, without a connection: from
QuicServer.endpointStats()andQuicClient.endpointStats().HKDF (RFC 5869) over an HMAC, and theHKDF-Expand-Labelof TLS 1.3 (RFC 8446 section 7.1) that QUIC uses for its secrets and keys (RFC 9001 section 5.1).A QUIC client endpoint on one UDP socket, from which any number of connections can be made.A QUIC connection with a blocking API made for virtual threads: open and accept streams, read and write them asInputStreams andOutputStreams, send and receive datagrams.Learns of an endpoint's connections as they open, complete their handshakes and close, for statistics: set withQuicServer.observe(io.github.mahmoudimus.quic.QuicConnection.Observer)orQuicClient.observe(io.github.mahmoudimus.quic.QuicConnection.Observer).Connection statistics.A blocking operation failed because its connection ended, or could not be established.A QUIC connection error (RFC 9000 section 20), carrying the error code aCONNECTION_CLOSEframe sends to the peer.A QUIC server on one UDP socket.Sees the datagrams a server receives that none of its connections claims (by Destination Connection ID) before its endpoint does: a client's first Initial, packets of unknown versions, packets for connections the server does not know.Where an unbound server's datagrams go: the transport it runs over instead of a socket.A stream operation failed because the peer abandoned the stream: it reset the stream (RESET_STREAM, seen by a reader) or asked this side to stop sending (STOP_SENDING, seen by a writer).How the peer abandoned the stream.The QUIC versions this module speaks: version 1 (RFC 9000) and version 2 (RFC 9369).The traffic secrets for one encryption level, as the TLS handshake hands them to packet protection: one secret per direction and the cipher suite they are for.A 16-byte stateless reset token (RFC 9000 section 10.3), as carried in NEW_CONNECTION_ID frames, thestateless_reset_tokentransport parameter and the tail of a Stateless Reset.QUIC variable-length integers (RFC 9000 section 16): values below 262, encoded in 1, 2, 4 or 8 bytes with the length in the two most significant bits of the first byte.