You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
net.TCPConn has a CloseWrite function that simulates what the docker client is doing to the underlying connection
I couldn't find much about the Upgrade: tcp header but it's not complying with the websocket standard (RFC: https://datatracker.ietf.org/doc/html/rfc6455). Maybe what Docker is doing seems like non-standard behaviour and abusing the http protocol in some ways which may be unsupported by the ReverseProxy?
What did you see happen?
ReverseProxy is closing the entire connection when a client closes the output.
The server can still write but the client is unable to receive from the server. The proxy might be closing the client connection by mistake because the client closed one of it's streams.
What did you expect to see?
The proxy should still be able to forward data from the server even when the client closed one of the streams.
The text was updated successfully, but these errors were encountered:
Go version
go version go1.23.2 linux/amd64
Output of
go env
in your module/workspace:What did you do?
Impacted by bug in rancher-desktop: rancher-sandbox/rancher-desktop#3239
Rancher-desktop uses
net/http/httputil.ReverseProxy
to proxy requests from the docker cli on linux to another WSL container via unix sockets.The Docker API uses a perhaps non-standard HTTP/1.1 websocket request to stream input/output from the containers (docker documentation: https://docs.docker.com/reference/api/engine/version/v1.47/#tag/Container/operation/ContainerAttach).
The bug is that
ReverseProxy
is closing the connection when the client closes the outbound socket.I was able to reproduce it, repo: https://github.com/matejkramny/go-proxy-bug
The long and short of the bug reproduction is:
httputil.ReverseProxy
Demonstrated here:
https://github.com/matejkramny/go-proxy-bug/blob/main/client/client_raw.go#L84
net.TCPConn
has aCloseWrite
function that simulates what the docker client is doing to the underlying connectionI couldn't find much about the
Upgrade: tcp
header but it's not complying with thewebsocket
standard (RFC: https://datatracker.ietf.org/doc/html/rfc6455). Maybe what Docker is doing seems like non-standard behaviour and abusing the http protocol in some ways which may be unsupported by the ReverseProxy?What did you see happen?
ReverseProxy is closing the entire connection when a client closes the output.
The server can still write but the client is unable to receive from the server. The proxy might be closing the client connection by mistake because the client closed one of it's streams.
What did you expect to see?
The proxy should still be able to forward data from the server even when the client closed one of the streams.
The text was updated successfully, but these errors were encountered: