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

proposal: x/net/http3: add HTTP/3 implementation #70914

Open
neild opened this issue Dec 18, 2024 · 15 comments
Open

proposal: x/net/http3: add HTTP/3 implementation #70914

neild opened this issue Dec 18, 2024 · 15 comments
Labels
Milestone

Comments

@neild
Copy link
Contributor

neild commented Dec 18, 2024

This is a proposal to add an HTTP/3 client and server implementation in x/net/http3.

Similarly to the accepted form of #58547 (x/net/quic), this proposal is to add an experimental package with an API subject to change during development. Once we have a complete implementation, we will file a separate proposal for API review.

Initial development will be in an internal package (x/net/internal/http3) until the details are firm enough for external testing. We will then move the package to x/net/http3 and (when we have some confidence the API is right) file the API review proposal.

@gopherbot gopherbot added this to the Proposal milestone Dec 18, 2024
@ianlancetaylor ianlancetaylor moved this to Incoming in Proposals Dec 18, 2024
@gabyhelp
Copy link

Related Issues

(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/641496 mentions this issue: quic, internal/quic/quicwire: split wire encode/decode functions to new package

gopherbot pushed a commit to golang/net that referenced this issue Jan 9, 2025
…ew package

HTTP/3 also uses QUIC varints. Move the more general-purpose wire
encoding/decoding functions into a new internal/quic/quicwire package
so they can be shared.

For golang/go#70914

Change-Id: Id888baf131e90a12247e15a6f7bc7dc37c6dc572
Reviewed-on: https://go-review.googlesource.com/c/net/+/641496
Auto-Submit: Damien Neil <dneil@google.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/641838 mentions this issue: internal/http3: basic stream read/write operations

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/641836 mentions this issue: internal/http3: new package

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/641837 mentions this issue: internal/http3: error codes

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/642115 mentions this issue: internal/http3: qpack wire primitives

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/642516 mentions this issue: internal/http3: add Transport and ClientConn

gopherbot pushed a commit to golang/net that referenced this issue Jan 14, 2025
Create a package for an HTTP/3 implementation.
Internal for now, intended to eventually move to x/net/http3.

For golang/go#70914

Change-Id: I3a643fe7958cf75b231ca97f25e9f338554f723c
Reviewed-on: https://go-review.googlesource.com/c/net/+/641836
Auto-Submit: Damien Neil <dneil@google.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
gopherbot pushed a commit to golang/net that referenced this issue Jan 14, 2025
Define constants for RFC 9114 and RFC 9204 error codes.

For golang/go#70914

Change-Id: Icddaf0ef1468adc6ac8e7b8739d45c8e4400f0e4
Reviewed-on: https://go-review.googlesource.com/c/net/+/641837
Auto-Submit: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
gopherbot pushed a commit to golang/net that referenced this issue Jan 14, 2025
Read and write HTTP/3 frames from QUIC streams.

The varint encoding/decoding overlaps a bit with that in
the quic package, but this package operates on streams while
the QUIC package operates on []bytes.

For golang/go#70914

Change-Id: I31115f5b572a59b899e2c880ecc86ba3caed982e
Reviewed-on: https://go-review.googlesource.com/c/net/+/641838
Auto-Submit: Damien Neil <dneil@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
gopherbot pushed a commit to golang/net that referenced this issue Jan 14, 2025
Encode and decode QPACK prefixed integers and string literals.

For golang/go#70914

Change-Id: Id12d1853738fc6d0e03bbbef36b67c24298451e1
Reviewed-on: https://go-review.googlesource.com/c/net/+/642115
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Auto-Submit: Damien Neil <dneil@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/642599 mentions this issue: internal/http3: QPACK encoding and decoding

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/643780 mentions this issue: http2, internal/httpcommon: factor out common request header logic for h2/h3

gopherbot pushed a commit to golang/net that referenced this issue Jan 22, 2025
Add the first rudiments of an HTTP/3 client.

The client currently opens a QUIC connection and creates a control
stream on it, and nothing else.

Add surrounding test infrastructure for examining the client's
behavior. Tests use the experimental testing/synctest package
and will only run when the Go version is at least Go 1.24 and
GOEXPERIMENT=synctest is set.

For golang/go#70914

Change-Id: I19803187a8e62c461f60d7a1d44c2a408377e342
Reviewed-on: https://go-review.googlesource.com/c/net/+/642516
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Auto-Submit: Damien Neil <dneil@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
gopherbot pushed a commit to golang/net that referenced this issue Jan 23, 2025
Basic support for encoding/decoding QPACK headers.

QPACK supports three forms of header compression:
Huffman-encoding of literal strings, a static table of
well-known header values, and a dynamic table of
header values negotiated between encoder and decoder
at runtime.

Right now, we support Huffman compression and the
static table, but not the dynamic table.
This is a supported mode for a QPACK encoder or
decoder, so we can leave dynamic table support
for after the rest of HTTP/3 is working.

For golang/go#70914

Change-Id: Ib694199b99c752a220d43f3a309169b16020b474
Reviewed-on: https://go-review.googlesource.com/c/net/+/642599
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Damien Neil <dneil@google.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/644116 mentions this issue: internal/http3: return error on mid-frame EOF

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/644118 mentions this issue: internal/http3: add RoundTrip

gopherbot pushed a commit to golang/net that referenced this issue Jan 24, 2025
…r h2/h3

HTTP/2 and HTTP/3 use the same set of pseudo-headers to represent
requests and responses. Move the http2 package's logic for validating
an http.Request and converting it to a set of pseudo-headers into
internal/httpcommon so it can be shared with HTTP/3.

For golang/go#70914

Change-Id: I80561752e821ccd0da2a811034c44f3f71064434
Reviewed-on: https://go-review.googlesource.com/c/net/+/643780
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Commit-Queue: Damien Neil <dneil@google.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Auto-Submit: Damien Neil <dneil@google.com>
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/644117 mentions this issue: internal/http3: define connection and stream error types

gopherbot pushed a commit to golang/net that referenced this issue Jan 24, 2025
When a stream ends in the middle of a frame,
return a non-EOF error from Read or ReadByte.

When a stream ends at the end of a frame,
don't return io.EOF from the Read call that reads
the last byte of the frame.
(This complicates stream.Read slightly,
but means that code that reads frames consistently
never sees an io.EOF, but gets an error if it tries
to read past the end of a frame.)

For golang/go#70914

Change-Id: If1b852716fe5e3aa3503f6970e2e1fba2ebb5f48
Reviewed-on: https://go-review.googlesource.com/c/net/+/644116
Auto-Submit: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
gopherbot pushed a commit to golang/net that referenced this issue Jan 24, 2025
HTTP/3 distinguishes between connection errors which result in an
entire connection closing, and stream errors which only terminate
a single request stream.

Define internal types to represent these two types of error.

For golang/go#70914

Change-Id: I907f395adc82a683b5c2eda65f936b1ab4904ffb
Reviewed-on: https://go-review.googlesource.com/c/net/+/644117
Reviewed-by: Jonathan Amsterdam <jba@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Damien Neil <dneil@google.com>
gopherbot pushed a commit to golang/net that referenced this issue Jan 28, 2025
Send request headers, receive response headers.

For golang/go#70914

Change-Id: I78d4dcc69c253ed7ad1543dfc3c5d8f1c321ced9
Reviewed-on: https://go-review.googlesource.com/c/net/+/644118
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Auto-Submit: Damien Neil <dneil@google.com>
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/644915 mentions this issue: internal/http3: add request/response body transfer

gopherbot pushed a commit to golang/net that referenced this issue Feb 4, 2025
For golang/go#70914

Change-Id: I372458214fe73f8156e0ec291168b043c10221e6
Reviewed-on: https://go-review.googlesource.com/c/net/+/644915
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Damien Neil <dneil@google.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/646617 mentions this issue: internal/http3: add Server

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/646616 mentions this issue: internal/http3: refactor in prep for sharing transport/server code

gopherbot pushed a commit to golang/net that referenced this issue Feb 5, 2025
Pull out various elements of the HTTP/3 client that can be
reused in the server. Move tests which can apply to client or server
connections into conn_test.go.

For golang/go#70914

Change-Id: I72b5eab55ba27df980ab2079120613f175b05927
Reviewed-on: https://go-review.googlesource.com/c/net/+/646616
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Auto-Submit: Damien Neil <dneil@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Incoming
Development

No branches or pull requests

3 participants