Skip to main content

Module frames

Module frames 

Source
Expand description

HTTP/2 frame parsing (RFC 7540 Section 4).

HTTP/2 frames have a fixed 9-byte header:

+-----------------------------------------------+
|                 Length (24)                   |
+---------------+---------------+---------------+
|   Type (8)    |   Flags (8)   |
+-+-------------+---------------+-------------------------------+
|R|                 Stream Identifier (31)                      |
+=+=============================================================+
|                   Frame Payload (0...)                      ...
+---------------------------------------------------------------+

This module provides types and functions for parsing all HTTP/2 frame types.

Modules§

error_codes
HTTP/2 error codes (RFC 7540 Section 7).
flags
Flag constants for HTTP/2 frame types (RFC 7540 Section 6).
settings_id
SETTINGS parameter identifiers (RFC 7540 Section 6.5.2).

Structs§

Http2Frame
A parsed HTTP/2 frame, holding the frame header fields and a reference to where the payload resides in the original buffer.

Enums§

Http2FrameType
HTTP/2 frame type identifiers (RFC 7540 Section 6).

Constants§

HTTP2_FRAME_HEADER_LEN
Length of the HTTP/2 frame header in bytes.
HTTP2_PREFACE
The HTTP/2 client connection preface (RFC 7540 Section 3.5).

Functions§

headers_fragment
Extract the header block fragment from a HEADERS frame payload.
parse_all_frames
Parse all HTTP/2 frames from a buffer.
parse_goaway
Parse a GOAWAY frame payload.
parse_priority
Parse a PRIORITY frame payload.
parse_rst_stream
Parse a RST_STREAM frame payload.
parse_settings
Parse a SETTINGS frame payload into a list of (id, value) pairs.
parse_window_update
Parse a WINDOW_UPDATE frame payload.