-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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/httputil: ReverseProxy doesn't support TCP half-close when HTTP is upgraded #35892
Comments
In order to support TCP half-close in ReverseProxy, ReverseProxy.handleUpgradeResponse should not close all sockets immediately when the one side gets an EOF. But we should close the write stream on the socket to inform the transfer is complete. Fixes golang#35892
Change https://golang.org/cl/209357 mentions this issue: |
Thank you for this bug report as well as CL and welcome to the Go project @sngchlko! I've added some feedback to your CL and we are currently in a code freeze until perhaps February 2020, but I look forward to encountering you more here and on the code review list and thank you again! |
Change https://go.dev/cl/564375 mentions this issue: |
Hi @odeke-em! |
Change https://go.dev/cl/637939 mentions this issue: |
Hi - I'm keen to try and make some progress on this issue as its the cause of rancher-sandbox/rancher-desktop#3239 which is limiting the use of rancher-desktop on WSL at least. I see the last two CLs ended up abandonend (https://golang.org/cl/209357, https://go.dev/cl/564375) but I'm not sure why, so I've re-submitted @callthingsoff implementation and extended the testing in this new CL https://go.dev/cl/637939. Hopefully we can get a version of this back. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I made the simple program to show the problem that I have.
This program has three servers: a frontend, a reverse proxy, and a backend.
After the frontend's HTTP upgrade request is accepted, the backend immediately closes the output stream. But the backend can't read the input stream because of the socket is closed by the reverse proxy.
I think
httputil.ReverseProxy
doesn't support TCP half-close.What did you expect to see?
The backend can read the input stream even though the output stream is closed.
backend got Hello
What did you see instead?
But the input stream was closed as well.
backend failed to read line from client: <nil>
The text was updated successfully, but these errors were encountered: