A Go library for services that talk to WebSocket APIs at high frequency, where a single connection bottlenecks under concurrent load but opening a new connection per request is too costly. wspool keeps a pool of reusable WebSocket connections and scales it dynamically with traffic.

The pool acquires and releases connections through a thread-safe interface, so multiple goroutines share it without external locking. It grows between a minimum and maximum connection count based on demand, enforces per-connection lifetime and idle timeouts, runs periodic health checks, and closes idle connections when traffic drops to free resources. It works either as a pooled client or as a standalone single-connection client, built on top of gorilla/websocket.

Go WebSocket Connection Pooling Concurrency

Personal open-source project, started 2024.