# xtaci/smux

A stream multiplexing library for Golang with minimal memory usage.

Repository: https://github.com/xtaci/smux
Canonical: https://ross.abutalabs.com/products/smux
Language: Go
License: MIT
License Family: permissive
Topics: stream-multiplexing
Last push: 2026-05-15T06:27:36+00:00

## Health v2 (maintenance only)
Score: 70/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 82, release rhythm 36, longevity 100
- inputs: {"age_days": 3659, "days_push": 110, "days_rel": 219, "gap_med": null, "n_releases_24m": 1}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1602, forks 229 (observed 2026-08-28T04:05:09.731328+00:00)

## What it is
Smux is a stream multiplexing library for Go that runs many logical streams over a single reliable connection such as TCP or KCP. It minimizes memory usage through a shared session-wide receive buffer, token-bucket flow control, and a slab-style frame allocator.

## Use cases
- multiplex many logical streams over a single TCP connection
- reduce connection overhead for tunnel or proxy software
- power connection management for KCP-based transports
- control memory usage across thousands of concurrent streams
- implement fair bandwidth sharing between streams
- build reliable ordered streams over custom io.ReadWriteCloser transports

## When to choose
- you need many concurrent streams over one connection in Go with low memory overhead
- you are building on kcp-go or a similar reliable underlying transport
- you need net.Conn-compatible streams with built-in flow control and traffic shaping

## When to avoid
- you need HTTP/2 or gRPC-level multiplexing with request semantics
- your underlying transport is unreliable and you are not using KCP
- you work outside the Go ecosystem

## Facets
- artifact type: library
- maturity: stable
- function: networking, concurrency, middleware
- domain: networking, developer-tools, microservices
- platform: go, cross-platform
- tags: stream-multiplexing, multiplexing, kcp, tcp, flow-control, net-conn

## Member repositories
- xtaci/smux (main) score 70

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:05:09.731328+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-30T03:52:38.586847+00:00, confidence not recorded.
  - readme: https://github.com/xtaci/smux (fetched 2026-08-28T04:05:09.731328+00:00, sha 72009cf79cb5)
- Data as of 2026-08-30T08:39:29.467469+00:00.
