Extensions API
HTTP/2

HTTP/2

Extensions can access detailed HTTP/2 connection data. The connection ID is found in the http2.connectionId field of a SessionEntry.


http2/get_stream_ids

Returns all stream IDs within an HTTP/2 connection, sorted in ascending order.

Parameters:

{
  connectionId: string;
}

Result: Option<Array<number>>


http2/get_stream

Returns the frame-level events for a specific HTTP/2 stream. Each event represents an HTTP/2 frame observed on one side of the connection.

Parameters:

{
  connectionId: string;
  streamId: number;
}

Result: Option<Array<Http2Event>>


HTTP/2 Event Types

type Http2Event = {
  side: Side;
  frame: Frame;
};

type Frame = {
  flags: Flags;
  payload: Payload;
};

type Flags = {
  value: number;
  defined: Array<NamedU8>;
};

type Payload =
  | { type: "data"; content: Data }
  | { type: "headers"; content: Headers }
  | { type: "priority"; content: Priority }
  | { type: "rst_stream"; content: RstStream }
  | { type: "settings"; content: Settings }
  | { type: "push_promise"; content: PushPromise }
  | { type: "ping"; content: Ping }
  | { type: "go_away"; content: GoAway }
  | { type: "window_update"; content: WindowUpdate }
  | { type: "continuation"; content: Continuation }
  | { type: "unknown"; content: UnknownPayload };

type Data = {
  paddingLen: Option<number>;
  data: string;                           // hex
};

type Headers = {
  paddingLen: Option<number>;
  priorityInfo: Option<Priority>;
  headerBlockFragment: string;            // hex
};

type Priority = {
  isExclusive: boolean;
  streamDependency: number;
  weight: number;
};

type RstStream = {
  errorCode: NamedU32;
};

type Settings = {
  settings: Array<SettingParameter>;
};

type SettingParameter = {
  identifier: NamedU16;
  value: number;
};

type PushPromise = {
  paddingLen: Option<number>;
  promisedStreamId: number;
  headerBlockFragment: string;            // hex
};

type Ping = {
  data: string;                           // hex
};

type GoAway = {
  lastStreamId: number;
  errorCode: NamedU32;
  debugData: string;                      // hex
};

type WindowUpdate = {
  windowSizeIncrement: number;
};

type Continuation = {
  fieldBlockFragment: string;             // hex
};

type UnknownPayload = {
  data: string;                           // hex
};