Skip to content

Close received after close #527

Open
@Adphi

Description

@Adphi

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

Activity

mafredri

mafredri commented on Apr 5, 2025

@mafredri
Member

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

Adphi commented on Apr 5, 2025

@Adphi
Author

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

Adphi commented on Apr 5, 2025

@Adphi
Author

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

mafredri

mafredri commented on Apr 5, 2025

@mafredri
Member

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

Adphi commented on Apr 5, 2025

@Adphi
Author

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/websocket@v1.8.13 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Close received after close · Issue #527 · coder/websocket