net/http: add HTTP2Config.EnableConnectProtocol#79300
Conversation
|
This PR (HEAD: e5bde2b) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/go/+/776300. Important tips:
|
Introduce EnableConnectProtocol to HTTP2Config, allowing HTTP/2 servers to opt in to advertising Extended CONNECT support (RFC 8441) on a per-server basis. Extended CONNECT was disabled by default in Go 1.24 because browsers interpret SETTINGS_ENABLE_CONNECT_PROTOCOL as implicit WebSocket-over-HTTP/2 support, which breaks servers whose WebSocket implementation does not support it (see golang#71128). EnableConnectProtocol provides the knob needed for WebSocket layers that do support Extended CONNECT to re-enable it without requiring GODEBUG=http2xconnect=1. This is a problem because http2xconnect is not accessible via the //go:debug directive. When enabled, HTTP/2 servers advertise SETTINGS_ENABLE_CONNECT_PROTOCOL in the initial SETTINGS frame. Incoming CONNECT requests that carry a :protocol pseudo-header are forwarded to the handler with that value accessible via r.Header.Get(":protocol"). The legacy disableExtendedConnectProtocol package variable and its GODEBUG knob are preserved for backwards compatibility. For golang#53208. For golang#71128.
|
Message from Gopher Robot: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/776300. |
|
Message from Tiago Silva: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/776300. |
|
This PR (HEAD: 616345e) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/go/+/776300. Important tips:
|
|
Message from Gopher Robot: Patch Set 1: Congratulations on opening your first change. Thank you for your contribution! Next steps: Most changes in the Go project go through a few rounds of revision. This can be During May-July and Nov-Jan the Go project is in a code freeze, during which Please don’t reply on this GitHub thread. Visit golang.org/cl/776300. |
net/http: add HTTP2Config.EnableConnectProtocol
Introduce EnableConnectProtocol to HTTP2Config, allowing HTTP/2
servers to opt in to advertising Extended CONNECT support (RFC 8441)
on a per-server basis.
Extended CONNECT was disabled by default in Go 1.24 because browsers
interpret SETTINGS_ENABLE_CONNECT_PROTOCOL as implicit
WebSocket-over-HTTP/2 support, which breaks servers whose WebSocket
implementation does not support it (see #71128). EnableConnectProtocol
provides the knob needed for WebSocket layers that do support Extended
CONNECT to re-enable it without requiring GODEBUG=http2xconnect=1.
This is a problem because http2xconnect is not accessible via the
//go:debug directive.
When enabled, HTTP/2 servers advertise SETTINGS_ENABLE_CONNECT_PROTOCOL
in the initial SETTINGS frame. Incoming CONNECT requests that carry a
:protocol pseudo-header are forwarded to the handler with that value
accessible via r.Header.Get(":protocol").
The legacy disableExtendedConnectProtocol package variable and its
GODEBUG knob are preserved for backwards compatibility.
For #53208.
For #71128.