Skip to content

P4: net and net/http, with HTTP/2 #6

Open

Description

@tamnd

Tracking issue for P4.

Goal: net, then net/http with HTTP/2. This is the headline, it is the reason most people will look at this project, and it is the most concurrency intensive code in the standard library, which means it is also where P0's scheduler finds out whether it was built correctly.

Gated on P3 for TLS. Small team, deep work, and not a phase that absorbs contributors the way P1 does.

Exit gate: the ordering and conformance tables in docs/design/11-packages-net.md sections 5 and 6, with h2spec passing in full.

net

net/url and net/textproto

These land in P1 because they are pure computation, and they are listed here because P4 is where they get their first real use.

net/http, server side

net/http, client side

HTTP/2

The rest of the tier

Security posture

Deferred to after 1.0

  • HTTP/3 and QUIC, behind a build flag, tracked but not blocking this milestone

Activity

  1. added this to the P4: net and http milestone on Sep 17, 2026
  2. added
    portPorting a standard library package, or part of one
    milestoneA tracking issue, one per milestone in the plan
    checklistA tracking issue whose body is a checklist of what is left
    area: netnet, net/http, http2, url, and the rest of the network stack
    on Sep 17, 2026
  3. tamnd commented on Oct 6, 2026

    @tamnd
    OwnerAuthor

    #361 is merged, which adds the address types from Go's ip.go (IP, IPMask, IPNet) along with SplitHostPort and JoinHostPort. It came early because crypto/x509 and crypto/tls need it. The ip_test.go port passes on server3 both natively and under ASan and UBSan. TestLookupWithIP is the only test left out, and it will come with the resolver.

  4. tamnd commented on Oct 6, 2026

    @tamnd
    OwnerAuthor

    #369 fixes a runtime bug that the net.Pipe tests ran into. When a channel close woke several goroutines blocked in a select, the select cleanup could put another goroutine's waiter back on the closed channel's queue, and freeing the channel then threw. The new select test fails 20 times out of 20 without the fix and passes 20 out of 20 with it on server3. The net.Conn PR comes next, rebased on top of it.

  5. tamnd commented on Oct 6, 2026

    @tamnd
    OwnerAuthor

    #371 is in: NetConn, NetAddr, NetListener, the net.Error checks, OpError, ErrClosed and net.Pipe. The pipe passes the nettest conformance suite ported from golang.org/x/net, and that suite is what turned up the select bug fixed in #369. TCP, UDP and Unix sockets come next, on top of the syscall socket calls and netpoll.

  6. tamnd commented on Oct 6, 2026

    @tamnd
    OwnerAuthor

    #372 is in: net/mail, with all ten of Go's tests and the four examples, plus two tests of burrow's own for Header.AddressList and the ReadMessage errors. net/smtp is next on that line, once net has TCP to run it over.

  7. tamnd commented on Oct 6, 2026

    @tamnd
    OwnerAuthor

    IDNA is in with #374. xnet/idna is a port of the copy of golang.org/x/net/idna that Go 1.27.1 vendors. Its tables are not written by hand: tools/gen-xnet-idna.sh reads them out of Go's own package. The tests are Go's from x/net and x/text, including all of IdnaTestV2.txt, plus a differential test against Go and a sweep over every rune that only the long runs do. I ticked the IDNA box.

  8. tamnd commented on Oct 7, 2026

    @tamnd
    OwnerAuthor

    Three more pieces of the HTTP stack are on main.

    PR Package What it is
    #380 golang.org/x/net/dns/dnsmessage DNS message packing and parsing, which the pure resolver will build on
    #386 golang.org/x/net/http2/hpack HPACK, the header compression HTTP/2 uses, with the Huffman tables and the test vectors from the RFC
    #387 golang.org/x/net/http/httpguts The token and header value checks that both net/http and the HTTP/2 code use

    The structured field value parser (#388) had a UBSan failure in CI: an empty string with a NULL pointer took a zero offset in one helper. That's fixed on the branch, and it goes in once CI is green again. The HTTP/2 frame layer (#389) is stacked on it.

  9. tamnd commented on Oct 7, 2026

    @tamnd
    OwnerAuthor

    Merged #388 and #389. #388 ports httpsfv, the RFC 8941 structured field value parser that net/http uses for headers like Priority. #389 ports the HTTP/2 frame layer: the framer that reads and writes every frame type, with the size and stream checks Go's has. HPACK is already in, so flow control and priority are what's left before the HTTP/2 server and client can start. CI passed on all 33 jobs for both, including the big-endian s390x build.

  10. tamnd commented on Oct 7, 2026

    @tamnd
    OwnerAuthor

    Opened #391, stacked on the Unix socket PR: the pure resolver's groundwork. It has the resolv.conf reader, the cached hosts file lookups, name validation, the SRV and MX ordering, and a public DNSError. No queries go out yet. Its 16 tests pass under gcc and under ASan and UBSan on Linux, and under wine.

    The wasip1 job on #384 failed because of an unused IPv6 probe helper that WASI never calls. The fix is on #383 and has been merged up through the stack.

  11. tamnd commented on Oct 7, 2026

    @tamnd
    OwnerAuthor

    #391 is merged, so the resolv.conf reader, the hosts file cache and DNSError are on main. I ticked the netFD and deadline items, since the poll FD (#378) carries both and the TCP, UDP and Unix PRs test deadlines on each socket type.

    Still in progress: the DNS client that sends queries, and Dial, Listen, Dialer and ListenConfig on top of it, with Happy Eyeballs for "tcp". Both are on branches and waiting for their test runs on Linux and under wine before the PRs go up.

  12. tamnd commented on Oct 9, 2026

    @tamnd
    OwnerAuthor

    The rest of the net package is up for review as a stack on top of #395:

    PR What
    #395 the DNS client and the lookup functions
    #411 Dialer, ListenConfig and the Resolve functions
    #412 PacketConn and ListenPacket
    #413 IPConn
    #414 the system resolver, the way Go's cgo resolver asks it
    #415 Interfaces, InterfaceAddrs, ParseMAC and the zone cache
    #416 ListenMulticastUDP
    #417 ReadMsg and WriteMsg for UDP, IP and Unix
    #418 Buffers, writev, and TCPConn.ReadFrom and WriteTo
    #419 FileConn, FileListener, FilePacketConn and the File methods
    #420 Dialer.DialIP and Multipath TCP

    #396 (log) and #397 (the net/http header code) are the first two pieces of net/http, which the HTTP server needs. The rest of the HTTP stack follows once these are in.

  13. 6 remaining items

  14. tamnd commented on Oct 14, 2026

    @tamnd
    OwnerAuthor

    net/smtp is in with #455: the client, PLAIN and CRAM-MD5 auth, and SendMail, at 25 of 27 items. StartTLS and TLSConnectionState wait for crypto/tls, and until then SendMail refuses a server that offers STARTTLS rather than send in the clear. 13 tests pass under plain, ASan and TSan builds on server3.

  15. tamnd commented on Oct 14, 2026

    @tamnd
    OwnerAuthor

    The net/http stack is merged, #456 to #476, 21 PRs in order: writing requests and responses, ServeMux, httptest, FileServer, the cookie jar, the HTTP/1 server and client, httptrace, httputil and ReverseProxy, cgi, fcgi, net/rpc, and the HTTP/2 flow control, schedulers, server and transport with their tests.

    Coverage on main after the merge:

    Package Items Status
    net/http 448/505 (88.7%) partial, 12 with the wrong signature
    net/http/httptest 27/33 partial, the rest needs crypto/tls
    net/http/httptrace 30/32 partial, the rest needs crypto/tls
    net/http/httputil 53/53 done
    net/http/cookiejar 9/9 done
    net/http/cgi 14/14 done
    net/http/fcgi 4/4 done
    net/rpc 57/57 done
    net/rpc/jsonrpc 5/5 done

    The stack tip was tested on server3 before the last merges from main, with ok 334 and fail 0 across the full suite, and the amalgamation build and doc check passed. Still open here: the rest of serve_test.go, the request smuggling regression set, h2spec, and the hardened mode.

  16. tamnd commented on Oct 21, 2026

    @tamnd
    OwnerAuthor

    #584 is merged. It adds a Limits section to docs/guides/net.md that lists the header and body limits Go applies by default, the default for each, and what changes it. They were already enforced in the same places Go enforces them, so this only documents them. I ticked the limits item.

  17. tamnd commented on Oct 21, 2026

    @tamnd
    OwnerAuthor

    #589 fixes a test-only leak in http_pprof_test. When TestDeltaProfile skipped because the mutex profile missed the hog, the arena was never freed, and the asan+ubsan job failed on it. Cleanups now free the arena and put the profile rate back. In 40 ASan runs on server3 the test skipped 16 times, and none of the runs had a leak report.

  18. tamnd commented on Oct 23, 2026

    @tamnd
    OwnerAuthor

    #599 is in: Server.ServeTLS, Server.ListenAndServeTLS and the package-level ServeTLS and ListenAndServeTLS, with HTTP/2 turned on by itself over TLS, the isBadCipher check, and the request's TLS state for handlers. It also fixed 64 functions in crypto/tls that left the error out-param unset on success, which is what made TestServeTLS hang at first. The Transport side of TLS and the httptest TLS server are next, then StartTLS for net/smtp.

  19. tamnd commented on Oct 23, 2026

    @tamnd
    OwnerAuthor

    #600, #602 and #603 are in. The Transport now does TLS on its own, with TLSClientConfig, TLSHandshakeTimeout, TLSNextProto and ForceAttemptHTTP2, and HTTP/2 comes on over TLS under Go's rules. httptrace has its two TLS handshake hooks, and httptest has NewTLSServer, StartTLS and Certificate, along with the transport tests that need a TLS server. #600 fixed a use-after-free that ASan found along the way: a retained certificate error now keeps its own copy of the certificates.

    The security fixes from go1.27.2 and go1.27.3 are tracked in #601.

  20. tamnd commented on Oct 23, 2026

    @tamnd
    OwnerAuthor

    Merged today: #604 adds StartTLS to net/smtp, so SendMail now switches to TLS when the server offers it. #605 fills in the request's TLS state in net/http/cgi. #606 adds the six request smuggling regression tests from serve_test.go. #607 is the first of the go1.27.2 security fixes (#601), the limit on Range headers.

  21. tamnd commented on Oct 24, 2026

    @tamnd
    OwnerAuthor

    The hardened build is in with #644. make HARDENED=1 or -DBURROW_HARDENED=ON turns on the compiler's bounds and object-size checks in trap mode, and lowers the HTTP server's default header limits to 64 KiB and 100 values. docs/guides/building.md has a section on what it turns on, and CI has a job that builds and tests it. The one CI failure on the PR was dudect on arm, which is #579.

  22. tamnd commented on Oct 25, 2026

    @tamnd
    OwnerAuthor

    #666 brings the transport and HTTP/2 server up to go1.27.3: only a body closed early is drained now, its trailer is discarded, and Request.TLS is set on any HTTP/2 request over TLS.

  23. tamnd commented on Oct 25, 2026

    @tamnd
    OwnerAuthor

    #674 added textproto.Dial, which was waiting for net. net/textproto is now at 64 of 64 and in the done list. The same PR fixes TestPipeline under -test.count, which kept the last run's state.

  24. tamnd commented on Oct 27, 2026

    @tamnd
    OwnerAuthor

    #716 adds HTTP/2 server push (Pusher, PushOptions) and the optional ResponseWriter interfaces as typedefs, with Go's server_push_test.go tests passing under ASan+UBSan, TSan and MSan in CI. #718 and #719 fix the amalgamation and the lint job, which #711 and #713 had broken. #717, which adds Request.Cancel, is waiting on its sanitizer jobs.

  25. tamnd commented on Oct 27, 2026

    @tamnd
    OwnerAuthor

    #721 ports Go 1.27's ClientConn and Transport.NewClientConn over HTTP/1 and HTTP/2, along with the six tests from clientconn_test.go in both modes. On a Linux box those tests and the transport, client and httptest tests passed plain, under ASan+UBSan, and under TSan. #717 added the deprecated Request.Cancel.

  26. tamnd commented on Oct 27, 2026

    @tamnd
    OwnerAuthor

    #722 ports the clientserver_test.go harness and the 33 tests from the top of the file down to TestStarRequestMethod, each in h1 and h2 mode. On server3 the plain, ASan+UBSan and TSan builds all pass, with 69 PASS, 0 SKIP and 0 FAIL in verbose mode. Next is the rest of the file, starting at TestTransportDiscardsUnneededConns.

  27. tamnd commented on Oct 27, 2026

    @tamnd
    OwnerAuthor

    #723 ports the next nine tests of clientserver_test.go, from TestTransportDiscardsUnneededConns to TestBadResponseAfterReadingBody. All 100 tests and subtests pass on server3, plain and under ASan+UBSan and TSan, with no skips. Next is the rest of the file from TestWriteHeader0. TestClientServerTLSConnWrapper needs a small library change first: the server and transport have to take the TLS state from a conn that isn't a TlsConn.

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

    area: netnet, net/http, http2, url, and the rest of the network stackchecklistA tracking issue whose body is a checklist of what is leftmilestoneA tracking issue, one per milestone in the planportPorting a standard library package, or part of one

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions