-
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
x/net/websocket: add Config.DialContext #57953
x/net/websocket: add Config.DialContext #57953
Comments
Right now there is no way to pass context.Context to websocket.Dial. In addition, this method can block indefinitely in the `NewClient` call. Fixes golang/go#57953
Change https://go.dev/cl/463097 mentions this issue: |
Hey what's the status of this, kinda curious |
It's on the list for the proposal review committee. |
This proposal has been added to the active column of the proposals project |
Have all concerns with this proposal been addressed? |
Based on the discussion above, this proposal seems like a likely accept. |
No change in consensus, so accepted. 🎉 |
I have a CL that implements this: https://go-review.googlesource.com/c/net/+/463097#message-31956dbc4b1568dbd323fd81a18b6a1fcb016c9e |
Right now there is no way to pass context.Context to websocket.Dial. In addition, this method can block indefinitely in the `NewClient` call. Fixes golang/go#57953
Right now there is no way to pass context.Context to websocket.Dial. In addition, this method can block indefinitely in the `NewClient` call. Fixes golang/go#57953
Change https://go.dev/cl/568198 mentions this issue: |
The comment of the DialConfig function was dropped during CL 463097. There doesn't seem to be a good reason to do that, so bring it back. For golang/go#57953. Change-Id: I3e458b7d18cdab95763f003da5a644c8287b54ad Reviewed-on: https://go-review.googlesource.com/c/net/+/568198 Reviewed-by: Dmitri Shuralyov <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Damien Neil <[email protected]> Auto-Submit: Dmitri Shuralyov <[email protected]>
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What did you do?
websocket.DialConfig
function can block indefinitely. While it's possible to specify the TLS connection timeout using theconfig
parameter, the function calls theNewClient
method that does read/write operations, and they can be blocked indefinitely.Also because the code is so old, there is no way to provide
context.Context
to support cancellation.What did you expect to see?
A way to not block the connection.
The text was updated successfully, but these errors were encountered: