Package io.github.mahmoudimus.http3
Record Class Http3ClientProfile
java.lang.Object
java.lang.Record
io.github.mahmoudimus.http3.Http3ClientProfile
- Record Components:
name- the profile's namesettings- the settings, in ordergreaseSetting- whether a GREASE setting (random id and value) follows themgreaseFrame- whether a GREASE frame (random type, 1 to 3 random bytes) follows SETTINGSpriorityUpdates- whether a request'spriorityis also sent as a PRIORITY_UPDATEpseudoHeaderOrder- the request pseudo-headers in the order they are sentlazyQpackStreams- whether the QPACK streams wait for their first instructionneqoGreaseFrame- whether the GREASE frame is neqo's (Firefox): a type from the whole reserved range and 0 to 7 random bytes, rather than Chrome's 1 to 3altUsed- whether requests carryalt-used(RFC 7838 section 5), naming the server, as Firefox's do over a connection it found by Alt-Svc
public record Http3ClientProfile(String name, Map<Long,Long> settings, boolean greaseSetting, boolean greaseFrame, boolean priorityUpdates, List<String> pseudoHeaderOrder, boolean lazyQpackStreams, boolean neqoGreaseFrame, boolean altUsed)
extends Record
What a client's HTTP/3 connections look like to a server: the SETTINGS on its control stream,
in order, with a GREASE setting (RFC 9114 section 7.2.4.1); a GREASE frame after them (section
7.2.8); a PRIORITY_UPDATE frame (RFC 9218) for each request that has a
priority; the
order of the request pseudo-headers; and whether the QPACK encoder and decoder streams are
opened only when there is something to send on them.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longPRIORITY_UPDATE for a request stream (RFC 9218 section 7.2). -
Constructor Summary
ConstructorsConstructorDescriptionHttp3ClientProfile(String name, Map<Long, Long> settings, boolean greaseSetting, boolean greaseFrame, boolean priorityUpdates, List<String> pseudoHeaderOrder, boolean lazyQpackStreams) A profile with Chrome's GREASE frame and noalt-used.Http3ClientProfile(String name, Map<Long, Long> settings, boolean greaseSetting, boolean greaseFrame, boolean priorityUpdates, List<String> pseudoHeaderOrder, boolean lazyQpackStreams, boolean neqoGreaseFrame, boolean altUsed) Creates an instance of aHttp3ClientProfilerecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanaltUsed()Returns the value of thealtUsedrecord component.static Http3ClientProfileChrome 156's, as captured over HTTP/3: QPACK_MAX_TABLE_CAPACITY 65536, MAX_FIELD_SECTION_SIZE 262144, QPACK_BLOCKED_STREAMS 100, H3_DATAGRAM 1 and a GREASE setting; a GREASE frame; PRIORITY_UPDATE for requests; pseudo-headers:method :authority :scheme :path; QPACK streams opened when first needed.final booleanIndicates whether some other object is "equal to" this one.static Http3ClientProfileFirefox 159's (neqo), as captured over HTTP/3: QPACK_MAX_TABLE_CAPACITY 65536, QPACK_BLOCKED_STREAMS 20, the WebTransport setting 0, H3_DATAGRAM 1 (its draft code point and RFC 9297's) and ENABLE_CONNECT_PROTOCOL 1, with no GREASE setting; neqo's GREASE frame; no PRIORITY_UPDATE; pseudo-headers:method :scheme :authority :path; the QPACK streams opened with the control stream;alt-usedon requests.booleanReturns the value of thegreaseFramerecord component.greaseFrame(RandomGenerator random) The GREASE frame for one connection, or null when the profile sends none.booleanReturns the value of thegreaseSettingrecord component.final inthashCode()Returns a hash code value for this object.booleanReturns the value of thelazyQpackStreamsrecord component.longReturns the MAX_FIELD_SECTION_SIZE advertised, 0 when not (unlimited).name()Returns the value of thenamerecord component.booleanReturns the value of theneqoGreaseFramerecord component.order(List<HeaderField> fields) fieldswith its request pseudo-headers in the profile's order, the rest after them as they were.priorityUpdate(long streamId, String priority) The PRIORITY_UPDATE for a request stream with apriorityfield value.booleanReturns the value of thepriorityUpdatesrecord component.Returns the value of thepseudoHeaderOrderrecord component.longReturns the QPACK_BLOCKED_STREAMS advertised, 0 when not.longReturns the QPACK_MAX_TABLE_CAPACITY advertised, 0 when not.settings()Returns the value of thesettingsrecord component.settings(RandomGenerator random) The SETTINGS for one connection: the profile's, then a GREASE setting with a random value.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
PRIORITY_UPDATE_REQUEST
public static final long PRIORITY_UPDATE_REQUESTPRIORITY_UPDATE for a request stream (RFC 9218 section 7.2).- See Also:
-
-
Constructor Details
-
Http3ClientProfile
public Http3ClientProfile(String name, Map<Long, Long> settings, boolean greaseSetting, boolean greaseFrame, boolean priorityUpdates, List<String> pseudoHeaderOrder, boolean lazyQpackStreams, boolean neqoGreaseFrame, boolean altUsed) Creates an instance of aHttp3ClientProfilerecord class.- Parameters:
name- the value for thenamerecord componentsettings- the value for thesettingsrecord componentgreaseSetting- the value for thegreaseSettingrecord componentgreaseFrame- the value for thegreaseFramerecord componentpriorityUpdates- the value for thepriorityUpdatesrecord componentpseudoHeaderOrder- the value for thepseudoHeaderOrderrecord componentlazyQpackStreams- the value for thelazyQpackStreamsrecord componentneqoGreaseFrame- the value for theneqoGreaseFramerecord componentaltUsed- the value for thealtUsedrecord component
-
Http3ClientProfile
public Http3ClientProfile(String name, Map<Long, Long> settings, boolean greaseSetting, boolean greaseFrame, boolean priorityUpdates, List<String> pseudoHeaderOrder, boolean lazyQpackStreams) A profile with Chrome's GREASE frame and noalt-used.
-
-
Method Details
-
chrome156
Chrome 156's, as captured over HTTP/3: QPACK_MAX_TABLE_CAPACITY 65536, MAX_FIELD_SECTION_SIZE 262144, QPACK_BLOCKED_STREAMS 100, H3_DATAGRAM 1 and a GREASE setting; a GREASE frame; PRIORITY_UPDATE for requests; pseudo-headers:method :authority :scheme :path; QPACK streams opened when first needed.- Returns:
- the profile
-
firefox159
Firefox 159's (neqo), as captured over HTTP/3: QPACK_MAX_TABLE_CAPACITY 65536, QPACK_BLOCKED_STREAMS 20, the WebTransport setting 0, H3_DATAGRAM 1 (its draft code point and RFC 9297's) and ENABLE_CONNECT_PROTOCOL 1, with no GREASE setting; neqo's GREASE frame; no PRIORITY_UPDATE; pseudo-headers:method :scheme :authority :path; the QPACK streams opened with the control stream;alt-usedon requests.- Returns:
- the profile
-
qpackMaxTableCapacity
public long qpackMaxTableCapacity()Returns the QPACK_MAX_TABLE_CAPACITY advertised, 0 when not.- Returns:
- the QPACK_MAX_TABLE_CAPACITY advertised, 0 when not
-
qpackBlockedStreams
public long qpackBlockedStreams()Returns the QPACK_BLOCKED_STREAMS advertised, 0 when not.- Returns:
- the QPACK_BLOCKED_STREAMS advertised, 0 when not
-
maxFieldSectionSize
public long maxFieldSectionSize()Returns the MAX_FIELD_SECTION_SIZE advertised, 0 when not (unlimited).- Returns:
- the MAX_FIELD_SECTION_SIZE advertised, 0 when not (unlimited)
-
settings
The SETTINGS for one connection: the profile's, then a GREASE setting with a random value.- Parameters:
random- the source of the GREASE setting- Returns:
- the settings, in order
-
greaseFrame
The GREASE frame for one connection, or null when the profile sends none.- Parameters:
random- the source of its type and payload- Returns:
- the frame
-
priorityUpdate
The PRIORITY_UPDATE for a request stream with apriorityfield value.- Parameters:
streamId- the request streampriority- the priority field value, such asu=0, i- Returns:
- the frame
-
order
fieldswith its request pseudo-headers in the profile's order, the rest after them as they were.- Parameters:
fields- a request's fields, pseudo-headers first- Returns:
- the reordered fields
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
settings
Returns the value of thesettingsrecord component.- Returns:
- the value of the
settingsrecord component
-
greaseSetting
public boolean greaseSetting()Returns the value of thegreaseSettingrecord component.- Returns:
- the value of the
greaseSettingrecord component
-
greaseFrame
public boolean greaseFrame()Returns the value of thegreaseFramerecord component.- Returns:
- the value of the
greaseFramerecord component
-
priorityUpdates
public boolean priorityUpdates()Returns the value of thepriorityUpdatesrecord component.- Returns:
- the value of the
priorityUpdatesrecord component
-
pseudoHeaderOrder
Returns the value of thepseudoHeaderOrderrecord component.- Returns:
- the value of the
pseudoHeaderOrderrecord component
-
lazyQpackStreams
public boolean lazyQpackStreams()Returns the value of thelazyQpackStreamsrecord component.- Returns:
- the value of the
lazyQpackStreamsrecord component
-
neqoGreaseFrame
public boolean neqoGreaseFrame()Returns the value of theneqoGreaseFramerecord component.- Returns:
- the value of the
neqoGreaseFramerecord component
-
altUsed
public boolean altUsed()Returns the value of thealtUsedrecord component.- Returns:
- the value of the
altUsedrecord component
-