Extensions API
Entries

Entries

Extensions can access detailed information about individual HTTP entries within a session, including request and response data, headers, bodies and WebSocket messages. All entry methods return null if the entry or session is not found.


sessions/get_entry

Returns the full data for a session entry including its request, response, timing information, TLS details and optional HTTP/2 stream reference.

Parameters:

{
  sessionId: string;
  entryId: string;
}

Result:

type SessionEntry = {
  id: string;
  url: string;
  clientAddr: Option<NetAddress>;
  remoteAddr: Option<NetAddress>;
  httpVersion: string;
  transactionType: "request" | "push_promise";
  request: Request;
  response: Option<Response>;
  isWebSocket: boolean;
  tls: TlsSettings;
  http2: Option<Http2StreamRef>;
  timings: Timings;
  process: Option<ProcessInfo>;
};

type NetAddress = {
  ip: string;
  port: Option<number>;
};

type Request = {
  method: Option<string>;
  path: Option<string>;
  httpVersion: Option<string>;
  headers: Array<[string, string]>;
  bodySize: Option<number>;
};

type Response = {
  httpVersion: Option<string>;
  statusCode: Option<number>;
  statusText: Option<string>;
  headers: Array<[string, string]>;
  bodySize: Option<number>;
};

type TlsSettings = {
  connectionId: Option<string>;
  tlsVersion: Option<NamedU16>;
  cipherSuite: Option<NamedU16>;
  ja3: Option<Ja3>;
  ja4: Option<Ja4>;
};

type Ja3 = {
  string: string;
  hash: string;
};

type Ja4 = {
  raw: string;
  hashed: string;
};

type Http2StreamRef = {
  connectionId: string;
  streamId: number;
};

type Timings = {
  startedAt: string;       // ISO 8601
  blocked: Option<number>;  // milliseconds
  dns: Option<number>;      // milliseconds
  connect: Option<number>;  // milliseconds
  send: Option<number>;     // milliseconds
  wait: Option<number>;     // milliseconds
  receive: Option<number>;  // milliseconds
  ssl: Option<number>;      // milliseconds
};

type ProcessInfo = {
  pid: number;
  name: Option<string>;
};

type NamedU16 = {
  value: number;
  name: string;
};

type Result = Option<SessionEntry>;

sessions/get_request_body

Returns the request body of an entry. The encoding parameter controls whether the body is returned as UTF-8 text or base64-encoded binary data.

Parameters:

{
  sessionId: string;
  entryId: string;
  encoding: "text" | "base64";
}

Result: Option<string>


sessions/get_response_body

Returns the response body of an entry. Works the same as sessions/get_request_body.

Parameters:

{
  sessionId: string;
  entryId: string;
  encoding: "text" | "base64";
}

Result: Option<string>


sessions/get_websocket_messages

Returns all WebSocket messages for an entry. Only applicable to entries where the isWebSocket field is true.

Parameters:

{
  sessionId: string;
  entryId: string;
}

Result:

type WebSocketMessage = {
  side: Side;
  startedAt: Option<string>;  // ISO 8601
  endedAt: Option<string>;    // ISO 8601
  payload: Payload;
};

type Payload =
  | { type: "text"; text: string }
  | { type: "binary"; data: string }    // base64
  | { type: "close"; code: number; reason: string }
  | { type: "ping"; data: string }      // base64
  | { type: "pong"; data: string }      // base64
  | { type: "unknown"; data: string };  // base64

type Result = Option<Array<WebSocketMessage>>;