# gobwas/ws

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/gobwas-ws).**

6,463 stars · 386 forks · Go · MIT

## Links

- GitHub: https://github.com/gobwas/ws
- awesome-repositories: https://awesome-repositories.com/repository/gobwas-ws.md

## Topics

`fast` `go` `golang` `rfc-6455` `websocket`

## Description

This Go library provides low-level components for implementing high-performance WebSocket connections. It focuses on minimal memory allocations and efficient data throughput via a dedicated frame processor, an HTTP connection upgrader, and a compression layer.

The project distinguishes itself through the use of zero-allocation buffer reuse to reduce garbage collection pressure. It operates directly on raw network bytes for frame parsing and manages the lifecycle of connections through state-based tracking.

The library covers core network protocol capabilities including the transformation of standard HTTP requests into persistent sockets, the application of compression algorithms to data streams, and the low-level processing of network packets.

## Tags

### Operating Systems & Systems Programming

- [Zero-Allocation Buffers](https://awesome-repositories.com/f/operating-systems-systems-programming/zero-allocation-buffers.md) — Utilizes pre-allocated byte slices for reading and writing network frames to eliminate intermediate memory allocations.
- [Network Frame Parsing](https://awesome-repositories.com/f/operating-systems-systems-programming/low-level-memory-io/network-frame-parsing.md) — Operates directly on raw network bytes to extract WebSocket headers and payloads without high-level abstractions.

### Networking & Communication

- [WebSocket Frame Processors](https://awesome-repositories.com/f/networking-communication/connection-control-frame-handlers/websocket-frame-processors.md) — Provides a dedicated frame processor for reading and writing network frames using low-level buffers.
- [Connection Upgraders](https://awesome-repositories.com/f/networking-communication/connection-management/websocket-connection-managers/connection-upgraders.md) — Provides a high-performance mechanism to transition standard HTTP requests into persistent WebSocket connections.
- [Go WebSocket Libraries](https://awesome-repositories.com/f/networking-communication/go-websocket-libraries.md) — Provides a high-performance, low-allocation WebSocket implementation specifically for the Go programming language.
- [WebSocket Protocol Upgrades](https://awesome-repositories.com/f/networking-communication/http-2-and-websocket-servers/websocket-protocol-upgrades.md) — Implements the mechanism for upgrading standard HTTP connections to the WebSocket protocol via a high-performance handshake.
- [WebSocket Packet Processing](https://awesome-repositories.com/f/networking-communication/packet-engines/packet-processing-frameworks/websocket-packet-processing.md) — Provides low-level buffer access for reading and writing network frames to increase throughput and reduce allocations. ([source](https://cdn.jsdelivr.net/gh/gobwas/ws@master/README.md))
- [Connection State Management](https://awesome-repositories.com/f/networking-communication/tcp-connection-lifecycles/connection-state-management.md) — Tracks the lifecycle and protocol state of individual sockets to ensure correct frame processing order.
- [WebSocket Implementations](https://awesome-repositories.com/f/networking-communication/websocket-implementations.md) — Provides a low-level implementation of the WebSocket protocol, including handshakes and persistent bidirectional communication.
- [Data Compression](https://awesome-repositories.com/f/networking-communication/data-compression.md) — Provides a compression layer to reduce network bandwidth usage for transmitted WebSocket data streams.
- [WebSocket Frame Compression](https://awesome-repositories.com/f/networking-communication/data-compression/message-body-compressors/websocket-frame-compression.md) — Implements a compression layer that reduces the size of individual WebSocket frames to save bandwidth.
- [High-Concurrency Networking](https://awesome-repositories.com/f/networking-communication/high-concurrency-networking.md) — Designed for high-concurrency networking using low-level buffer management to process large volumes of packets.
- [Real-Time Data Streams](https://awesome-repositories.com/f/networking-communication/real-time-data-streams.md) — Enables the creation of low-latency systems that push frequent real-time updates to connected clients.

### Part of an Awesome List

- [Communication and Real-time](https://awesome-repositories.com/f/awesome-lists/media/communication-and-real-time.md) — A low-level, high-performance WebSocket development package.
