Skip to main content
Experimental Crate: codec

seleniumbase_rs_codec::akamai parses and renders Akamai HTTP/2 fingerprint strings, in the format of Akamai’s public whitepaper on passive HTTP/2 fingerprinting: four sections separated by |.

  • SETTINGS is id:value pairs joined by ;, in the order the frame carried them.
  • WINDOW_UPDATE is the connection-level increment, or 0 when no frame was sent.
  • PRIORITY is stream:exclusive:depends_on:weight entries joined by ,, or 0 for none. The weight is the protocol weight, 1 to 256 (the wire byte plus one).
  • The pseudo-header order is a permutation of m,a,s,p (:method, :authority, :scheme, :path).

Parsing is strict about what can exist on the wire: canonical decimal numbers only, each SETTINGS id once, weights in 1 to 256, stream ids below 2^31. What a given client stack can emit is a separate question, answered by H2Spec.

Akamai#

struct

A parsed Akamai HTTP/2 fingerprint. The fields are public so a caller can build one directly; Akamai::parse is the validating constructor, and H2Spec::with_akamai checks again whatever it is given. Display writes the canonical string and FromStr parses, so a canonical string round-trips.

settingsVec<(u16, u32)>#

SETTINGS entries (id, value) in the order the frame carried them.

window_updateu32#

The connection-level WINDOW_UPDATE increment; 0 means no frame.

priority_framesVec<PriorityFrame>#

PRIORITY frames in the order they were sent.

pseudo_order[Pseudo; 4]#

The order of the four request pseudo-headers.

Akamai::parse#

method

Parses an Akamai fingerprint string. Leading and trailing whitespace is ignored; nothing inside the string is. Returns an AkamaiError naming the section and entry that is malformed.

PriorityFrame#

struct

One PRIORITY frame, in the Akamai notation stream:exclusive:depends_on:weight (its Display, with exclusive written 0 or 1).

stream_idu32#

The stream the frame prioritises.

exclusivebool#

Whether the dependency is exclusive.

depends_onu32#

The stream this one depends on.

weightu16#

The protocol weight, 1 to 256 (the wire byte plus one).

Pseudo#

enum

A request pseudo-header, as named in the pseudo-header order section. This is the complete set of pseudo-headers of a plain request, so the enum is not non_exhaustive: a pseudo-header order is a permutation of exactly these four. In JSON it is written in lower case ("method", "authority", …).

Pseudoenum#

ALL is the order m,a,s,p. letter and header_name give the letter and the header name (:method); from_letter accepts lowercase letters only, and from_header_name the exact name.

AkamaiError#

enum

Why an Akamai string was refused. index is the zero-based position of the entry and token the offending text.

AkamaiErrorenum#

Constants#

const

The largest stream id, dependency id or window increment (2^31 - 1, the top bit is reserved); the smallest and largest protocol weight (the wire byte is one less); the longest string accepted, in bytes; and the most SETTINGS and PRIORITY entries in one string.