# coder/websocket

Minimal and idiomatic WebSocket library for Go

Repository: https://github.com/coder/websocket
Canonical: https://ross.abutalabs.com/products/coder-websocket
Language: Go
License: ISC
License Family: permissive
Topics: go, websocket, http2, idiomatic, minimal
Last push: 2026-06-15T03:38:49+00:00

## Health v2 (maintenance only)
Score: 79/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 87, release rhythm 57, longevity 100
- inputs: {"age_days": 2942, "days_push": 79, "days_rel": 79, "gap_med": 228.0, "n_releases_24m": 3}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 5432, forks 374 (observed 2026-08-28T04:09:18.015296+00:00)

## What it is
A minimal and idiomatic WebSocket library for Go, originally by nhooyr and now maintained by Coder. It offers zero-dependency, context-first WebSocket client and server implementations with JSON helpers, compression, and Wasm support.

## Use cases
- add websocket support to a go http server
- build a real-time chat backend in go
- stream json messages over websockets in go
- compile a websocket client to wasm
- implement ping/pong keepalive for websocket connections
- replace gorilla/websocket with a maintained minimal library

## When to choose
- you want a zero-dependency, idiomatic Go WebSocket library with first-class context.Context support
- you need RFC 7692 permessage-deflate compression or JSON message helpers
- you target Wasm or want zero-alloc reads and writes

## When to avoid
- you need HTTP/2 WebSocket support, which is still on the roadmap
- you require graceful shutdown or heartbeat helpers that are not yet implemented
- you need a batteries-included WebSocket framework rather than a minimal library

## Facets
- artifact type: library
- maturity: active
- function: websocket, http-server, serialization
- domain: web-development, backend, networking
- platform: go, cross-platform, wasm
- tags: zero-dependencies, context-aware, rfc-7692-compression, wsjson, minimal-api, real-time

## Member repositories
- coder/websocket (main) score 79

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:09:18.015296+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T17:56:53.898461+00:00, confidence not recorded.
  - readme: https://github.com/coder/websocket (fetched 2026-08-28T04:09:18.015296+00:00, sha 7e43fefa1614)
- Data as of 2026-08-30T08:39:29.467469+00:00.
