Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net/http: document http2 extended connect support #71128

Open
rthellend opened this issue Jan 4, 2025 · 5 comments
Open

net/http: document http2 extended connect support #71128

rthellend opened this issue Jan 4, 2025 · 5 comments
Labels
Documentation Issues describing a change to documentation. NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Milestone

Comments

@rthellend
Copy link

Go version

go version 1.24rc1

Output of go env in your module/workspace:

AR='ar'
CC='gcc'
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_ENABLED='1'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
CXX='g++'
GCCGO='gccgo'
GO111MODULE=''
GOAMD64='v1'
GOARCH='amd64'
GOAUTH='netrc'
GOBIN=''
GOCACHE='/home/robin/.cache/go-build'
GODEBUG=''
GOENV='/home/robin/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFIPS140='off'
GOFLAGS=''
GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build2734898122=/tmp/go-build -gno-record-gcc-switches'
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMOD='/home/robin/src/tlsproxy/go.mod'
GOMODCACHE='/home/robin/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/home/robin/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/home/robin/src/goroot'
GOSUMDB='sum.golang.org'
GOTELEMETRY='local'
GOTELEMETRYDIR='/home/robin/.config/go/telemetry'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/home/robin/src/goroot/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='devel go1.24-705b5a569a Fri Jan 3 14:40:11 2025 -0800'
GOWORK=''
PKG_CONFIG='pkg-config'

What did you do?

This change, which should be autogenerated appears to have picked up an unintended change to src/net/http/h2_bundle.go

https://go-review.googlesource.com/c/go/+/631336

https://go-review.googlesource.com/c/go/+/631336/2/src/net/http/h2_bundle.go

all: update vendored dependencies [generated]

The Go 1.24 code freeze has recently started. This is a time to update
all golang.org/x/... module versions that contribute packages to the
std and cmd modules in the standard library to latest master versions.

For [#36905](https://go.dev/issue/36905).

[git-generate]
go install golang.org/x/build/cmd/updatestd@latest
go install golang.org/x/tools/cmd/bundle@latest
updatestd -goroot=$(pwd) -branch=master

What did you see happen?

The change to h2_bundle.go that enables the Extended Connect Protocol is undocumented.

What did you expect to see?

The change should either be documented or removed.

@gopherbot gopherbot added the Documentation Issues describing a change to documentation. label Jan 4, 2025
@seankhliao seankhliao changed the title net/http: undocumented (unintended?) change that enables extended connect protocol net/http: document http2 extended connect support Jan 4, 2025
@seankhliao seankhliao added NeedsFix The path to resolution is known, but the work has not been done. release-blocker labels Jan 4, 2025
@seankhliao seankhliao added this to the Go1.24 milestone Jan 4, 2025
@seankhliao
Copy link
Member

The change looks intentional (part of #49918).
I think this just needs a release note?

cc @WeidiDeng @neild

@rthellend
Copy link
Author

I doubt this is actually intentional. It will break existing websocket implementations. If anything, the feature should be optional (off by default).

Browsers will start trying to open websockets using h2, and it will fail unless there is code in the server to handle those requests.

@rthellend
Copy link
Author

Here's a boiled down example that demonstrates the problem: https://gist.github.com/rthellend/e77264034eb761ccf32abd274792775a

2025/01/04 16:19:27 HTTP/2.0 GET /
2025/01/04 16:19:27 HTTP/2.0 CONNECT /websocket
2025/01/04 16:19:27 ERR websocket: the client is not using the websocket protocol: 'upgrade' token not found in 'Connection' header

@prattmic
Copy link
Member

prattmic commented Jan 6, 2025

This was added in https://go.dev/cl/610977. I'll leave it to @neild to say whether it is intentional/correct, but I also want to point out that #70728 was filed as a follow-up issue, which I've tentatively made a release blocker as well, and the CL has another comment about a potential deadlock with no issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Issues describing a change to documentation. NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Projects
None yet
Development

No branches or pull requests

5 participants