Skip to content

Support HTTP/1.1 upgrade to HTTP/2 via h2c #1

Open

Description

@jfallows

Support HTTP/1.1 implicitly via http/1.1.
Support HTTP/2 implicitly, assuming client prior knowledge of server HTTP/2 support via h2.
Support HTTP/1.1 upgrade to HTTP/2 via h2c.

See https://httpwg.org/specs/rfc7540.html#discover-http.

See specs added for h2c upgrade when starting HTTP/2.

Implementation approach:

on decoded http 1.1 headers
  normally creates an HttpExchange and sends BEGIN w/ HttpBeginEx
  if upgrade: htc + HTTP2Settings detected...
    send 101 switching protocols w/ upgrade: h2c
    handoff to Http2Server stream for further decode and encode
      HttpServer (http/1.1) will delegate directly to Http2Server::onNetMessage
      create an HttpExchange (http2) and send BEGIN w/ HttpBeginEx
      initial decode state allows body to be decoded for (upgraded) request body
      lack of flow control prevents response from being sent to client
      client sends PRI ..., then SETTINGS, then WINDOW_UPDATE
      on flow control available, WINDOW sent to HttpExchange (http2) response
      response encoded via HTTP/2 stream #1 as required

Activity

  1. added
    enhancement
    on Dec 21, 2021
  2. jfallows commented on May 4, 2022

    @jfallows
    ContributorAuthor

    Unified http/1.1 and h2 support into http binding, now need to support h2c upgrade.

  3. changed the title [-]Unify HTTP/1.1 and HTTP/2 support in http server binding[/-] [+]Support HTTP/1.1 upgrade to HTTP/2 via h2c[/+] on May 4, 2022
  4. jfallows commented on Feb 3, 2023

    @jfallows
    ContributorAuthor
  5. added a commit that references this issue on Mar 13, 2025
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

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions