Package org.microproxy.frames
Interface Http3Frame
- All Superinterfaces:
HttpFrame
- All Known Implementing Classes:
Http3Frame.CancelPush,Http3Frame.Data,Http3Frame.GoAway,Http3Frame.Headers,Http3Frame.MaxPushId,Http3Frame.PushPromise,Http3Frame.Settings,Http3Frame.Unknown
public sealed interface Http3Frame
extends HttpFrame
permits Http3Frame.Data, Http3Frame.Headers, Http3Frame.CancelPush, Http3Frame.Settings, Http3Frame.PushPromise, Http3Frame.GoAway, Http3Frame.MaxPushId, Http3Frame.Unknown
An HTTP/3 frame (RFC 9114 section 7.2) as a
FrameInterceptor sees it, decoded, with
header sections as field lists (Field) decoded through QPACK. HTTP/3 frames carry no
stream id or flags: the QUIC stream they travel on says which stream, and its end ends the
message; FrameContext.streamId() names the stream.
The proxy shows these frames to a FrameInterceptor live where it speaks HTTP/3 (a
reverse proxy's HTTP/3 listener, and connections to HTTP/3 servers), and an Http3FramePipeline runs an interceptor over the bytes of HTTP/3 streams relayed by other means.
Records are immutable apart from their byte arrays, which are not copied; edit a frame with its
with... methods.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordCANCEL_PUSH (section 7.2.3), on the control stream.static final recordDATA (section 7.2.1).static final recordGOAWAY (section 7.2.6), on the control stream: from a server, the first client-initiated request stream it will not process; from a client, a push id.static final recordHEADERS (section 7.2.2), with its field section decoded.static final recordMAX_PUSH_ID (section 7.2.7), from a client on the control stream.static final recordPUSH_PROMISE (section 7.2.5), from a server on a request stream.static final recordSETTINGS (section 7.2.4), the first frame of the control stream.static final recordA frame of an extension or reserved type, such as a grease frame (type0x1f * N + 0x21) or PRIORITY_UPDATE (RFC 9218). -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longThe largest variable-length integer, 2^62-1.static final longSETTINGS_ENABLE_CONNECT_PROTOCOL (RFC 9220).static final longSETTINGS_H3_DATAGRAM (RFC 9297).static final longSETTINGS_MAX_FIELD_SECTION_SIZE.static final longSETTINGS_QPACK_BLOCKED_STREAMS (RFC 9204).static final longSETTINGS_QPACK_MAX_TABLE_CAPACITY (RFC 9204).static final longThe type code of CANCEL_PUSH.static final longThe type code of DATA.static final longThe type code of GOAWAY.static final longThe type code of HEADERS.static final longThe type code of MAX_PUSH_ID.static final longThe type code of PUSH_PROMISE.static final longThe type code of SETTINGS. -
Method Summary
Modifier and TypeMethodDescriptionstatic Http3Frame.Datadata(byte[] data) A DATA frame to inject.static Http3Frame.HeadersA HEADERS frame to inject.default FrameProtocolprotocol()The protocol the frame belongs to.static longThe identifier of a setting named assettingName(long)names it (aSETTINGS_prefix is allowed), or written as a number.static StringsettingName(long id) The name of a setting without itsSETTINGS_prefix, or its hexadecimal identifier for another one.static Http3Frame.Unknownunknown(long type, byte[] payload) A frame of an extension type to inject; peers ignore types they do not know.
-
Field Details
-
TYPE_DATA
static final long TYPE_DATAThe type code of DATA.- See Also:
-
TYPE_HEADERS
static final long TYPE_HEADERSThe type code of HEADERS.- See Also:
-
TYPE_CANCEL_PUSH
static final long TYPE_CANCEL_PUSHThe type code of CANCEL_PUSH.- See Also:
-
TYPE_SETTINGS
static final long TYPE_SETTINGSThe type code of SETTINGS.- See Also:
-
TYPE_PUSH_PROMISE
static final long TYPE_PUSH_PROMISEThe type code of PUSH_PROMISE.- See Also:
-
TYPE_GOAWAY
static final long TYPE_GOAWAYThe type code of GOAWAY.- See Also:
-
TYPE_MAX_PUSH_ID
static final long TYPE_MAX_PUSH_IDThe type code of MAX_PUSH_ID.- See Also:
-
SETTINGS_QPACK_MAX_TABLE_CAPACITY
static final long SETTINGS_QPACK_MAX_TABLE_CAPACITYSETTINGS_QPACK_MAX_TABLE_CAPACITY (RFC 9204).- See Also:
-
SETTINGS_MAX_FIELD_SECTION_SIZE
static final long SETTINGS_MAX_FIELD_SECTION_SIZESETTINGS_MAX_FIELD_SECTION_SIZE.- See Also:
-
SETTINGS_QPACK_BLOCKED_STREAMS
static final long SETTINGS_QPACK_BLOCKED_STREAMSSETTINGS_QPACK_BLOCKED_STREAMS (RFC 9204).- See Also:
-
SETTINGS_ENABLE_CONNECT_PROTOCOL
static final long SETTINGS_ENABLE_CONNECT_PROTOCOLSETTINGS_ENABLE_CONNECT_PROTOCOL (RFC 9220).- See Also:
-
SETTINGS_H3_DATAGRAM
static final long SETTINGS_H3_DATAGRAMSETTINGS_H3_DATAGRAM (RFC 9297).- See Also:
-
MAX_VARINT
static final long MAX_VARINTThe largest variable-length integer, 2^62-1.- See Also:
-
-
Method Details
-
protocol
Description copied from interface:HttpFrameThe protocol the frame belongs to.- Specified by:
protocolin interfaceHttpFrame- Returns:
FrameProtocol.HTTP_2orFrameProtocol.HTTP_3
-
data
A DATA frame to inject.- Parameters:
data- the content- Returns:
- the frame
-
headers
A HEADERS frame to inject.- Parameters:
fields- the field section, pseudo-headers first- Returns:
- the frame
-
unknown
A frame of an extension type to inject; peers ignore types they do not know.- Parameters:
type- the type code, not one HTTP/3 defines or reserves for HTTP/2payload- the payload- Returns:
- the frame
-
settingName
The name of a setting without itsSETTINGS_prefix, or its hexadecimal identifier for another one.- Parameters:
id- the setting identifier- Returns:
- a name such as
QPACK_MAX_TABLE_CAPACITY, or0x...
-
settingId
The identifier of a setting named assettingName(long)names it (aSETTINGS_prefix is allowed), or written as a number.- Parameters:
name- the setting's name or number- Returns:
- the identifier
- Throws:
IllegalArgumentException- for a name that is neither
-