Skip to content

Handle HTTP2 connections #979

Closed
Closed

Description

@Keksoj

The HTTP2 protocol has its own way of managing connections, with certain frames being used for performing a handshake, a ping, etc. See the RFC.

Sōzu needs to handle such incoming frames.


Update — 2026-04-24

Implemented on feat/h2-mux (PR #1209) in lib/src/protocol/mux/h2.rs (~7190 LOC). Handled frames and mechanisms:

  • Connection preface + SETTINGS handshake with ACK, timeout enforcement, and 64-entry cap (RFC 9113 §6.5).
  • HEADERS / CONTINUATION with standalone-CONTINUATION guard (GOAWAY PROTOCOL_ERROR).
  • DATA with Content-Length reconciliation.
  • WINDOW_UPDATE at connection and stream level with 50%-threshold coalescing (RFC 9113 §6.9).
  • GOAWAY graceful drain (peer_last_stream_id replay above cut-off) (§6.8).
  • RST_STREAM (received + emitted lifetime caps).
  • PING with flood threshold.
  • PRIORITY (legacy) and PRIORITY_UPDATE (RFC 9218 §7.1).

Conformance: passes 145/145 h2spec cases. Security: dedicated H2FloodDetector covers Rapid Reset (CVE-2023-44487), CONTINUATION flood (CVE-2024-27316), and MadeYouReset (CVE-2025-8671), plus per-window caps on PING, SETTINGS, empty DATA, and cumulative protocol abuse.

Suggest closing on merge of #1209.

Activity

  1. added this to the HTTP2 milestone on Aug 9, 2023
  2. FlorentinDUBOIS commented on Apr 27, 2026

    @FlorentinDUBOIS
    Collaborator

    Closed by #1209 — feat(h2): HTTP/2 support via unified Mux session layer.

    H2 connection-level handling is now implemented:

    • Full RFC 9113 frame state machine: SETTINGS handshake, PING, RST_STREAM, GOAWAY, WINDOW_UPDATE, CONTINUATION, PRIORITY_UPDATE (RFC 9218).
    • Graceful drain via draining flag + peer_last_stream_id: streams above the last-stream-id are retried on a new connection.
    • Connection lifecycle: handshake → operational → drain → close, with default-answer streams flushed before closure.
    • Flood/abuse detection (Rapid Reset, MadeYouReset, glitch counters) terminating with GOAWAY(ENHANCE_YOUR_CALM).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions