Skip to content

Close received after close #527

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

Open
Adphi opened this issue Apr 5, 2025 · 5 comments
Open

Close received after close #527

Adphi opened this issue Apr 5, 2025 · 5 comments

Comments

@Adphi
Copy link

Adphi commented Apr 5, 2025

Somewhere between v1.8.10 and v1.8.11 (probably b0ec201), Websockets stopped working on Chrome (android) with the following error:

WebSocket connection to 'wss://[...]' failed: Close received after close
@mafredri
Copy link
Member

mafredri commented Apr 5, 2025

Hey, which version of the library are you using currently?

And it seems like the error you are seeing is from this library acting as a client? Could you give a bit more detail about how you are using this library as well as what's going on in the other end (Chrome/Android)? If you can, a minimum reproduction would be helpful.

@Adphi
Copy link
Author

Adphi commented Apr 5, 2025

We don't use it directly. It is used by github.com/improbable-eng/grpc-web.

Somehow, nhooyr.io/websocket was updated to v1.8.17 in one of our projects go.mod, which broke the application on Chrome/Android.
We had to revert to v1.8.10:

replace nhooyr.io/websocket => nhooyr.io/websocket v1.8.10

@Adphi
Copy link
Author

Adphi commented Apr 5, 2025

The server code is in websocket_wrapper.go.
The client code is the nice-grpc-web websocket transport.

@mafredri
Copy link
Member

mafredri commented Apr 5, 2025

I would recommend switching over to this repo and giving the latest release a try, which has a potential fix for the issue you’re experiencing.

https://github.com/coder/websocket/releases/tag/v1.8.13

@Adphi
Copy link
Author

Adphi commented Apr 5, 2025

It does not seems to be possible:

replace nhooyr.io/websocket => github.com/coder/websocket v1.8.13
$ go mod tidy                                
go: finding module for package github.com/coder/websocket/internal/errd
go: finding module for package github.com/coder/websocket
go: finding module for package github.com/coder/websocket/internal/test/xrand
go: finding module for package github.com/coder/websocket/internal/test/assert
go: finding module for package github.com/coder/websocket/internal/test/wstest
go: finding module for package github.com/coder/websocket/internal/wsjs
go: finding module for package github.com/coder/websocket/internal/util
go: finding module for package github.com/coder/websocket/internal/bpool
go: finding module for package github.com/coder/websocket/internal/xsync
go: finding module for package github.com/coder/websocket/wsjson
go: found github.com/coder/websocket/internal/bpool in github.com/coder/websocket v1.8.13
go: found github.com/coder/websocket/internal/errd in github.com/coder/websocket v1.8.13
go: found github.com/coder/websocket/internal/util in github.com/coder/websocket v1.8.13
go: found github.com/coder/websocket/internal/wsjs in github.com/coder/websocket v1.8.13
go: found github.com/coder/websocket in github.com/coder/websocket v1.8.13
go: found github.com/coder/websocket/internal/test/assert in github.com/coder/websocket v1.8.13
go: found github.com/coder/websocket/internal/test/wstest in github.com/coder/websocket v1.8.13
go: found github.com/coder/websocket/internal/test/xrand in github.com/coder/websocket v1.8.13
go: found github.com/coder/websocket/internal/xsync in github.com/coder/websocket v1.8.13
go: found github.com/coder/websocket/wsjson in github.com/coder/websocket v1.8.13
go: github.com/coder/[email protected] used for two different module paths (github.com/coder/websocket and nhooyr.io/websocket)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants