-
Notifications
You must be signed in to change notification settings - Fork 315
document http client must use context timeout and not timeout on struct #341
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
Ah right, I'll document this. |
Was this implemented in the project? I'm having the same problem here, but i use |
Nothing to implement, just an unfortunate quirk of |
Looking at the readme example, I switched to |
Ah right yea so I'll change the code here to remove the Timeout from |
I believe that nothing needs to be done, as The bug occurred after closing the connection and reopening. Thank you for creating this library and being active in the project |
Oh interesting, I'll definitely test to make sure. |
Fixed in dev. |
when I set http.DefaultClient.Timeout = time.Second * 10, websocket.Dial will get an error "failed to WebSocket dial: response body is not a io.ReadWriteCloser: *http.cancelTimerBody"
verson: nhooyr.io/websocket v1.8.7
this is because in the dial.go line 128: rwc, ok := respBody.(io.ReadWriteCloser), it convert respBody to an io.ReadWriteCloser, I think it should be rwc, ok := respBody.(io.ReadCloser).
in general, respBody is a *http.readWriteCloserBody, but if http.DefaultClient.Timeout is set, it will be a *http.cancelTimerBody, which is just an io.ReadCloser.
The text was updated successfully, but these errors were encountered: