镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Research HTTP/2 support and protocol negotiation #455

Open

Description

@lukewilliamboswell

Context

The current HTTP stack enables only the http1 features in Cargo.toml and constructs its connector with enable_http1() in src/http.rs. HTTP/1.1 is widely interoperable, but HTTP/2 can improve connection reuse, multiplexing, and header compression, and some services or protocols require it.

Adding HTTP/2 also has costs and design questions. It introduces more code and dependencies into every statically linked application, and the host currently creates a new Hyper client for each request, which limits the benefit of multiplexing and connection pooling.

Research questions

Investigate and document:

  • actual interoperability or performance needs for HTTP/2 in basic-cli applications;
  • binary-size, compile-time, memory, and runtime costs on every supported target;
  • supporting HTTP/1.1 and HTTP/2 through TLS ALPN negotiation versus exposing an explicit protocol choice;
  • whether cleartext HTTP/2 (h2c) is in scope;
  • whether the HTTP client should be shared across requests to make connection pooling and HTTP/2 multiplexing useful;
  • request, response, timeout, and error behavior that may differ by protocol;
  • tests for HTTP/1.1 fallback, successful HTTP/2 negotiation, and protocol-specific failures.

Desired outcome

Record whether basic-cli should support HTTP/2, with a recommendation and measured tradeoffs. If support is recommended, define an implementation plan that preserves HTTP/1.1 compatibility and keeps the public API and runtime behavior explicit.

Keep the public runtime documentation updated with the chosen behavior.

Related work

Activity

  1. notramo commented on Sep 2, 2026

    @notramo

    The additional costs are worth it, because HTTP/1.1 has a very bad design flaw:
    https://portswigger.net/research/http1-must-die
    https://http1mustdie.com/

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

    enhancementNew feature or request

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions