Skip to content
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

Migrate off github.com/gorilla/websocket #1970

Closed
Tracked by #1916
guseggert opened this issue Dec 31, 2022 · 2 comments · Fixed by #1982
Closed
Tracked by #1916

Migrate off github.com/gorilla/websocket #1970

guseggert opened this issue Dec 31, 2022 · 2 comments · Fixed by #1982
Assignees
Labels
effort/days Estimated to take multiple days, but less than a week kind/maintenance Work required to avoid breaking changes or harm to project's status quo

Comments

@guseggert
Copy link
Contributor

guseggert commented Dec 31, 2022

The github.com/gorilla/websocket module, used for WebSocket support by go-libp2p, was recently archived and is no longer maintained.

The only other serious option I can find is https://github.com/nhooyr/websocket, but it does not support HTTP/2. There is also an attempt to fork the Gorilla repos here: https://github.com/gorillaincubator. Or go-libp2p could maintain its own fork.

@marten-seemann
Copy link
Contributor

marten-seemann commented Dec 31, 2022

Thank you for opening this issue @guseggert. This is annoying, but I can't really say that this comes as a surprise.

Or go-libp2p could maintain its own fork.

Given our recent experience with maintaining our own forks of libraries, I'd really really like to avoid that.

The only other serious option I can find is https://github.com/nhooyr/websocket, but it does not support HTTP/2.

To be honest, I don't think we need to care a lot about HTTP/2. Our use is having a single WebSocket connection on top of one TCP connection, so we don't really benefit from HTTP/2's stream multiplexing. Given that we're only doing a single WebSocket Upgrade request, the savings due to HPACK should be minimal as well.

There's also https://pkg.go.dev/golang.org/x/net/websocket, but it claims to lack some features of Gorilla and nhooyr (without specifying which 🙄). From a cursory glance at the godoc, Dial doesn't take context.Context (and there's no DialContext or similar), which suggests that it's not well maintained.
UPDATE: Yes, looks like it's deprecated: golang/go#18152.

@marten-seemann marten-seemann added kind/maintenance Work required to avoid breaking changes or harm to project's status quo effort/days Estimated to take multiple days, but less than a week labels Dec 31, 2022
@guseggert
Copy link
Contributor Author

I also found this, I haven't done a deep dive so I don't know how appropriate it is: https://github.com/lesismal/nbio

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort/days Estimated to take multiple days, but less than a week kind/maintenance Work required to avoid breaking changes or harm to project's status quo
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants