finds.dev← search

// the find

gobwas/ws

★ 6,467 · Go · MIT · updated Feb 2026

A tiny WebSocket library for Go.

A low-level WebSocket library for Go that trades ease of use for performance. The core design is zero-copy upgrades and no mandatory allocations during I/O — you get direct access to frames and connection state. The `wsutil` package sits on top for when you don't want to manage framing yourself.

Zero-copy HTTP upgrade avoids the allocation cost that gorilla/websocket pays on every connection, which matters if you're handling thousands of concurrent connections. The two-tier API (raw `ws` vs `wsutil`) is honest design — use `wsutil` to ship fast, drop to `ws` when you need to control buffer reuse. Passes the full Autobahn test suite, so RFC6455 compliance is verified, not assumed. The `wsflate` package integrates permessage-deflate without locking you to a specific compression implementation — you plug in `compress/flate` or something else.

78% test coverage on a protocol library is low; the uncovered 22% is exactly where edge cases and framing bugs live. The compression API is genuinely awkward — the `wsutil` + `wsflate` dance with `MessageState`, `StateExtended`, and manual `Reset()` calls is a footgun for anyone not reading carefully. No context cancellation support in the core read/write paths, so graceful shutdown under load requires rolling your own deadline management. Last meaningful commit activity has slowed significantly; the library is stable but effectively in maintenance mode, which is fine for a protocol that doesn't change, but means PRs and issues sit.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →