]> Cypherpunks repositories - gostls13.git/commit
net/http: support TCP half-close when HTTP is upgraded in ReverseProxy
authorMark Wakefield <mark.a.wakefield@gmail.com>
Thu, 2 Jan 2025 19:18:01 +0000 (19:18 +0000)
committerGopher Robot <gobot@golang.org>
Tue, 4 Mar 2025 12:59:32 +0000 (04:59 -0800)
commita053e79024f56a2a64728b1287509e880fad203e
treeafa45059034bc993551e95bb231e1abd7f267c01
parent7181118a851bc22cf7acc604fe24940eb4926288
net/http: support TCP half-close when HTTP is upgraded in ReverseProxy

This CL propagates closing the write stream from either side of the
reverse proxy and ensures the proxy waits for both copy-to and the
copy-from the backend to complete.

The new unit test checks communication through the reverse proxy when
the backend or frontend closes either the read or write streams.
That closing the write stream is propagated through the proxy from
either the backend or the frontend. That closing the read stream is
not propagated through the proxy.

Fixes #35892

Change-Id: I83ce377df66a0f17b9ba2b53caf9e4991a95f6a0
Reviewed-on: https://go-review.googlesource.com/c/go/+/637939
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Sean Liao <sean@liao.dev>
Auto-Submit: Sean Liao <sean@liao.dev>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Matej Kramny <matejkramny@gmail.com>
src/net/http/httputil/reverseproxy.go
src/net/http/httputil/reverseproxy_test.go
src/net/http/transport.go