Skip to content

Support plain text upgrade from HTTP/1.1 to HTTP/2 #10275

Closed
@kitsonk

Description

@kitsonk

The native HTTP server should support "transparent" upgrades to HTTP/2 from HTTP/1.1 instead of only support ALPN negotiation.

If I send the headers like:

GET / HTTP/1.1
Host: localhost:8000
Accept: */*
Connection: Upgrade, HTTP2-Settings
Upgrade: h2c
HTTP2-Settings: AAMAAABkAARAAAAAAAIAAAAA

The native should respond with a status of 101 Switching Protocols and use the base64 encoded HTTP2-Settings header to establish the connection.

Activity

added
featnew feature (which has been agreed to/accepted)
ext/fetchrelated to the ext/fetch
on Apr 20, 2021
lucacasonato

lucacasonato commented on Oct 11, 2023

@lucacasonato
Member

The server can not initiate a h2 upgrade. Clients first have to send a request with Upgrade: h2c to the server.

Firstly, this can likely only reasonably be supported for HTTP/1.1 GET or HEAD requests, because we can not replay request body streams. We may even have to disable duplex streaming.

Browsers do not support this, and in practice I don't see plain text H1 -> H2 upgrades being used. I'll close this as "not in scope" for now - if things change we can reopen this possibly, but right now not worth the implementation complexity and tradeoffs.

josephrocca

josephrocca commented on Jun 23, 2024

@josephrocca
Contributor

FWIW, I found this issue via a web search while trying to use HTTP/2 to get around concurrent connection limit problems with HTTP/1. It's just for an internal tool, hosted on 127.0.0.1 so I don't need HTTPS - it just adds headaches.

I'm very naive in this area, so I'm not sure if there's any reasonable way to make it easier to use the features of HTTP/2 without having to deal with self-signed cert stuff (on the server and the client), but if it's possible for Deno with that, it would be very welcome!

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

    ext/fetchrelated to the ext/fetchfeatnew feature (which has been agreed to/accepted)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @josephrocca@kitsonk@lucacasonato

        Issue actions

          Support plain text upgrade from HTTP/1.1 to HTTP/2 · Issue #10275 · denoland/deno