Closed
Description
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.
Metadata
Metadata
Assignees
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
lucacasonato commentedon Oct 11, 2023
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 commentedon Jun 23, 2024
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!