Minimal and idiomatic WebSocket library for Go
5.3k
Stars
366
Forks
67
Open issues
30
Contributors
AI Analysis
A minimal and idiomatic WebSocket library for Go that prioritizes simplicity and standards compliance. It serves Go developers building real-time communication systems who want a lightweight alternative to heavier frameworks. Best suited for teams that value clean APIs and zero dependencies over feature abundance.
Inferred from signals mentioned in the README (tests, CI, type safety) — not a review of the actual code.
AI's overall editorial judgment — not an average of the bars above, can weigh other factors too.
Coder-maintained Go WebSocket library offering idiomatic API, zero deps, and full autobahn compliance
coder/websocket (formerly nhooyr/websocket) is a minimal Go WebSocket library designed for developers who want context-aware, zero-dependency, allocation-efficient WebSocket handling without the API quirks of older libraries. It targets Go backend developers building real-time servers or clients who prioritize idiomatic Go patterns. Actively maintained by Coder (the company behind coder.com), it serves as a credible alternative to the widely used but no-longer-maintained gorilla/websocket. Its adoption appears meaningful given its star count and the vacuum left by gorilla's maintenance stall.
Originally authored by nhooyr starting in 2019 as a cleaner alternative to gorilla/websocket. Coder adopted maintenance in 2024 after nhooyr stepped back, providing corporate backing. The import path changed from nhooyr.io/websocket to github.com/coder/websocket.
Growth was initially organic among Go developers frustrated with gorilla/websocket's unmaintained status and API limitations. The 2024 handoff to Coder gave the project renewed visibility and institutional support. Gorilla/websocket's effective abandonment created a migration opportunity, accelerating adoption. The 27 stars in 7 days as of late June 2026 suggests slow but steady ongoing interest rather than viral spikes.
Coder itself uses this library in its own product (coder.com), providing at least one known production user at meaningful scale. Given 5,304 stars and 364 forks, broader production usage is likely but not independently documented beyond the Coder use case in the available metadata. Adoption in the broader Go ecosystem is plausible given gorilla/websocket's maintenance stall driving migration, but concrete third-party production deployments are not verified from available evidence.
Appears to be a single-package core library with a wsjson subpackage for JSON helpers. Likely wraps net/http for dialing, enabling future HTTP/2 compatibility. The net.Conn wrapper suggests a thin abstraction layer. Zero-dependency design likely means all WebSocket framing is implemented in pure Go without pulling in external packages.
README displays a Go Coverage badge linking to a coverage report hosted on GitHub Pages, indicating automated coverage tracking is in place. Exact percentage not stated in the README excerpt, but the presence of a public coverage badge suggests the maintainers treat test coverage as a visible quality signal. The project also claims full autobahn-testsuite compliance, which is a rigorous protocol-level test harness.
Last push was June 15, 2026 — 12 days before the evaluation date — indicating active, recent maintenance. Corporate stewardship by Coder reduces bus-factor risk. The roadmap lists several open enhancements including assembly-optimized masking (with a WIP PR), graceful shutdown helpers, and wstest.Pipe, suggesting the project has a clear forward direction rather than being in pure maintenance mode.
ADOPT IF: you are building a new Go service requiring WebSocket support and want idiomatic context-aware APIs, zero external dependencies, Wasm compatibility, and active maintenance. AVOID IF: you need prepared messages for broadcast-heavy scenarios, require fine-grained buffer control, or have an existing large gorilla/websocket codebase where migration cost outweighs benefits. MONITOR IF: you are evaluating it for high-frequency trading or extreme throughput applications — the pending assembly masking implementation (3x speedup) could shift that calculus once merged.
Independent dimensions
Mainstream potential
6/10
Technical importance
8/10
Adoption evidence
4/10
- Coder is a commercial company; if Coder pivots, is acquired, or deprioritizes open source work, the project could lose its primary maintainer again as it did with nhooyr.
- The import path change from nhooyr.io/websocket means existing users must update module paths, creating migration friction that may slow adoption among projects with large dependency graphs.
- Assembly-optimized masking (the 3x performance improvement) remains unmerged as of the README, meaning the performance ceiling is not yet fully realized for CPU-bound workloads.
- HTTP/2 WebSocket support is listed as a long-term roadmap item but not implemented, which may be a blocker for environments strictly requiring HTTP/2 infrastructure.
- Mainstream adoption evidence beyond Coder's own usage is not independently verified, making it harder to assess real-world battle-testing at diverse scales.
Likely to consolidate its position as the preferred modern Go WebSocket library as gorilla/websocket migrations continue. Growth will remain steady rather than explosive given the niche is well-defined and the Go ecosystem is mature.
Explore similar
Newsletter
Get analyses like this every Monday
Free weekly digest of the most interesting open-source discoveries.
Languages
Information
- Language
- Go
- License
- ISC
- Last updated
- 4w ago
- Created
- 96mo ago
- Analyzed with
- anthropic/claude-haiku-4-5
Stars over time
Contributors over time
Top 100 contributors only — repos with more will plateau at 100.
Open issues
Top contributors
Similar repos
| Repository | Stars | Week Δ | Language | Score | Updated |
|---|---|---|---|---|---|
|
|
5.3k | +12 | Go | 8/10 | 4w ago |
|
|
6.5k | — | Go | 8/10 | 5mo ago |
|
|
22.8k | — | JavaScript | 9/10 | 6d ago |
|
|
17.5k | — | Go | 7/10 | 12h ago |
|
|
15.2k | — | Go | 8/10 | 12h ago |
|
|
18.9k | — | C++ | 9/10 | 4d ago |
The dominant historical choice in Go, now effectively unmaintained. Gorilla has a larger installed base and prepared-write support but lacks context.Context support, has allocation overhead, no Wasm target, and a less idiomatic API. coder/websocket is technically superior on most modern Go design criteria, though migration requires API changes.
gobwas/ws is extremely low-level and flexible, targeting high-performance scenarios where the caller manages buffering and frame parsing manually. It has slightly more stars but serves a different audience — developers willing to trade API ergonomics for maximum control. coder/websocket is the better choice for standard use cases; gobwas/ws for extreme throughput optimization.
Officially deprecated by the Go team. The README explicitly calls this out and positions coder/websocket as the migration target via its net.Conn wrapper. Not a real competitor for new projects.
Not a direct competitor — different language ecosystem. Included in similar repos list likely due to naming similarity. Not relevant for Go backend developers.
A C++ library targeting maximum performance, not relevant for pure-Go projects. Comparison is not meaningful for the Go ecosystem audience of coder/websocket.