Record Class Http3ClientProfile

java.lang.Object
java.lang.Record
io.github.mahmoudimus.http3.Http3ClientProfile
Record Components:
name - the profile's name
settings - the settings, in order
greaseSetting - whether a GREASE setting (random id and value) follows them
greaseFrame - whether a GREASE frame (random type, 1 to 3 random bytes) follows SETTINGS
priorityUpdates - whether a request's priority is also sent as a PRIORITY_UPDATE
pseudoHeaderOrder - the request pseudo-headers in the order they are sent
lazyQpackStreams - whether the QPACK streams wait for their first instruction
neqoGreaseFrame - 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 3
altUsed - whether requests carry alt-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

    Fields
    Modifier and Type
    Field
    Description
    static final long
    PRIORITY_UPDATE for a request stream (RFC 9218 section 7.2).
  • Constructor Summary

    Constructors
    Constructor
    Description
    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 no alt-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 a Http3ClientProfile record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns the value of the altUsed record component.
    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.
    final boolean
    Indicates whether some other object is "equal to" this one.
    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-used on requests.
    boolean
    Returns the value of the greaseFrame record component.
    The GREASE frame for one connection, or null when the profile sends none.
    boolean
    Returns the value of the greaseSetting record component.
    final int
    Returns a hash code value for this object.
    boolean
    Returns the value of the lazyQpackStreams record component.
    long
    Returns the MAX_FIELD_SECTION_SIZE advertised, 0 when not (unlimited).
    Returns the value of the name record component.
    boolean
    Returns the value of the neqoGreaseFrame record component.
    fields with 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 a priority field value.
    boolean
    Returns the value of the priorityUpdates record component.
    Returns the value of the pseudoHeaderOrder record component.
    long
    Returns the QPACK_BLOCKED_STREAMS advertised, 0 when not.
    long
    Returns the QPACK_MAX_TABLE_CAPACITY advertised, 0 when not.
    Returns the value of the settings record component.
    The SETTINGS for one connection: the profile's, then a GREASE setting with a random value.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • PRIORITY_UPDATE_REQUEST

      public static final long PRIORITY_UPDATE_REQUEST
      PRIORITY_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 a Http3ClientProfile record class.
      Parameters:
      name - the value for the name record component
      settings - the value for the settings record component
      greaseSetting - the value for the greaseSetting record component
      greaseFrame - the value for the greaseFrame record component
      priorityUpdates - the value for the priorityUpdates record component
      pseudoHeaderOrder - the value for the pseudoHeaderOrder record component
      lazyQpackStreams - the value for the lazyQpackStreams record component
      neqoGreaseFrame - the value for the neqoGreaseFrame record component
      altUsed - the value for the altUsed record 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 no alt-used.
  • Method Details

    • chrome156

      public static Http3ClientProfile 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

      public static Http3ClientProfile 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-used on 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

      public Map<Long,Long> settings(RandomGenerator random)
      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

      public Http3Frame greaseFrame(RandomGenerator random)
      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

      public Http3Frame priorityUpdate(long streamId, String priority)
      The PRIORITY_UPDATE for a request stream with a priority field value.
      Parameters:
      streamId - the request stream
      priority - the priority field value, such as u=0, i
      Returns:
      the frame
    • order

      public List<HeaderField> order(List<HeaderField> fields)
      fields with 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

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • name

      public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • settings

      public Map<Long,Long> settings()
      Returns the value of the settings record component.
      Returns:
      the value of the settings record component
    • greaseSetting

      public boolean greaseSetting()
      Returns the value of the greaseSetting record component.
      Returns:
      the value of the greaseSetting record component
    • greaseFrame

      public boolean greaseFrame()
      Returns the value of the greaseFrame record component.
      Returns:
      the value of the greaseFrame record component
    • priorityUpdates

      public boolean priorityUpdates()
      Returns the value of the priorityUpdates record component.
      Returns:
      the value of the priorityUpdates record component
    • pseudoHeaderOrder

      public List<String> pseudoHeaderOrder()
      Returns the value of the pseudoHeaderOrder record component.
      Returns:
      the value of the pseudoHeaderOrder record component
    • lazyQpackStreams

      public boolean lazyQpackStreams()
      Returns the value of the lazyQpackStreams record component.
      Returns:
      the value of the lazyQpackStreams record component
    • neqoGreaseFrame

      public boolean neqoGreaseFrame()
      Returns the value of the neqoGreaseFrame record component.
      Returns:
      the value of the neqoGreaseFrame record component
    • altUsed

      public boolean altUsed()
      Returns the value of the altUsed record component.
      Returns:
      the value of the altUsed record component