Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upnet/http/httputil: ReverseProxy - websocket connections cannot be canceled #35559
Labels
Milestone
Comments
This comment has been minimized.
This comment has been minimized.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What version of Go are you using (
go version
)?(also checked master)
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?Up to date Arch Linux amd64
go env
OutputWhat did you do?
httputil.NewSingleHostReverseProxy
to create a proxy to a backend server which serves websockets.context.WithCancel(...)
.What did you expect to see?
I expected the reverse proxy to close the connection to the backend server.
What did you see instead?
The connection between the reverse proxy and the backend server was preserved.
Hi All,
I quickly modified the
TestReverseProxyWebSocket
test to reproduce my issue eshard@73147b8 (I modified TestReverseProxyWebSocket in place to make the diff more readable)I also did a dirty fix: eshard@98e746e which propagates the cancelation to the
handleUpgradeResponse
function. It creates an additional goroutine so it's not ideal.I'd be happy to improve my patch with your inputs
Best regards
Pierre