Tako ("octopus" in Japanese) is a pragmatic, ergonomic and extensible Rust framework for services that go beyond plain HTTP. Build one cohesive application across HTTP/1.1, HTTP/2, HTTP/3, WebSocket, SSE, gRPC, TCP, UDP, Unix sockets, and WebTransport with a single routing, middleware, and observability model.
Blog posts:
Tako is built for teams that want fewer moving parts in production:
- One service, many transports β Serve REST, WebSockets, SSE, gRPC, raw TCP/UDP, Unix sockets, and QUIC-based workloads without switching frameworks.
- One mental model, two runtimes β Use the same framework style on Tokio or Compio depending on the deployment constraints.
- Application primitives included β Middleware, auth, metrics, signals, queues, graceful shutdown, and streaming are part of the framework story, not an afterthought.
- Performance knobs when they matter β SIMD JSON, optional zero-copy extractors, compression, jemalloc, and HTTP/3 support are available without fragmenting the API.
- Strong fit for real systems β API backends, realtime apps, protocol gateways, internal platforms, and edge-facing services.
- Multi-transport by design β HTTP/1.1, HTTP/2, HTTP/3 (QUIC), WebSocket, WebTransport, SSE, gRPC, TCP, UDP, Unix sockets, and PROXY protocol.
- Dual runtime support β First-class support for both Tokio and Compio, including TLS and HTTP/2 on both sides where supported.
- Built-in platform primitives β Background job queue, in-process signals, metrics hooks, graceful shutdown, static files, and stream helpers.
- Rich middleware and auth β JWT, Basic, Bearer, API key, CSRF, sessions, body limits, request IDs, security headers, upload progress, rate limiting, CORS, idempotency, and compression.
- Strongly typed extraction β 22+ extractors for JSON, form, query, path, headers, cookies, JWT claims, API keys, Accept, Range, protobuf, multipart, and more.
- Performance paths included β SIMD JSON (
sonic-rs/simd-json), optional zero-copy extractors, brotli/gzip/deflate/zstd, and jemalloc support. - Realtime-ready β Streaming responses, SSE, WebSockets, GraphQL subscriptions, HTTP/3, and WebTransport under one crate.
- Docs and API surface included β OpenAPI via
utoipaorvespera, GraphiQL support, and a growing example suite for common deployment patterns.
Choose Tako when your service needs one or more of these:
- More than REST β You need HTTP APIs plus WebSockets, SSE, gRPC, TCP, UDP, or QUIC in the same application.
- Realtime coordination β You want built-in signals, queues, and streaming primitives instead of composing everything manually.
- Framework consolidation β You would rather depend on one coherent crate than glue together several partially overlapping libraries.
- Protocol-heavy infrastructure β Gateways, internal platforms, telemetry collectors, control planes, or edge services are a particularly strong fit.
| Protocol | Tokio | Compio | Feature flag |
|---|---|---|---|
| HTTP/1.1 | β | β | default |
| HTTP/2 | β | β | http2 |
| HTTP/3 (QUIC) | β | β | http3 |
| TLS (rustls) | β | β | tls / compio-tls |
| WebSocket | β | β | default / compio-ws |
| WebTransport | β | β | webtransport |
| SSE | β | β | default |
| gRPC (unary) | β | β | grpc |
| Raw TCP | β | β | default |
| Raw UDP | β | β | default |
| Unix sockets | β | β | default (unix only) |
| PROXY protocol v1/v2 | β | β | default |
| Extractor | Description |
|---|---|
Json<T> |
JSON body (with optional SIMD acceleration) |
Form<T> |
URL-encoded form body |
Query<T> |
URL query parameters |
Path<T> |
Route path parameters |
Params |
Dynamic path params map |
HeaderMap |
Full request headers |
Bytes |
Raw request body |
State<T> |
Shared application state |
CookieJar |
Cookie reading/writing |
SignedCookieJar |
HMAC-signed cookies |
PrivateCookieJar |
Encrypted cookies |
BasicAuth |
HTTP Basic authentication |
BearerAuth |
Bearer token extraction |
JwtClaims<T> |
JWT token validation & claims |
ApiKey |
API key from header/query |
Accept |
Content negotiation |
AcceptLanguage |
Language negotiation |
Range |
HTTP Range header |
IpAddr |
Client IP address |
Protobuf<T> |
Protocol Buffers body |
SimdJson<T> |
Force SIMD JSON parsing |
Multipart |
Multipart form data |
| Middleware | Description |
|---|---|
| JWT Auth | Validate JWT tokens on routes |
| Basic Auth | HTTP Basic authentication |
| Bearer Auth | Bearer token validation |
| API Key Auth | Header or query-based API key |
| CSRF | Double-submit cookie CSRF protection |
| Session | Cookie-based sessions (in-memory store) |
| Security Headers | HSTS, X-Frame-Options, CSP, etc. |
| Request ID | Generate/propagate X-Request-ID |
| Body Limit | Enforce max request body size |
| Upload Progress | Track upload progress callbacks |
| CORS | Cross-Origin Resource Sharing |
| Rate Limiter | Token-bucket rate limiting |
| Compression | Brotli / gzip / deflate / zstd |
| Idempotency | Idempotency key deduplication |
| Metrics | Prometheus / OpenTelemetry export |
| Flag | Description |
|---|---|
http2 |
HTTP/2 support (ALPN h2) |
http3 |
HTTP/3 over QUIC (enables webtransport) |
tls |
HTTPS via rustls |
compio |
Compio async runtime (alternative to tokio) |
compio-tls |
TLS on compio |
compio-ws |
WebSocket on compio |
grpc |
gRPC unary RPCs with protobuf |
protobuf |
Protobuf extractor (prost) |
plugins |
CORS, compression, rate limiting |
simd |
SIMD JSON parsing (sonic-rs + simd-json) |
multipart |
Multipart form-data extractors |
file-stream |
File streaming & range requests |
async-graphql |
GraphQL integration |
graphiql |
GraphiQL IDE endpoint |
signals |
In-process pub/sub signal system |
jemalloc |
jemalloc global allocator |
zstd |
Zstandard compression (in plugins) |
tako-tracing |
Distributed tracing subscriber |
utoipa |
OpenAPI docs via utoipa |
vespera |
OpenAPI docs via vespera |
metrics-prometheus |
Prometheus metrics export |
metrics-opentelemetry |
OpenTelemetry metrics export |
zero-copy-extractors |
Zero-copy body extraction |
client |
Outbound HTTP client |
MSRV 1.87.0 | Edition 2024
Tako already powers real-world services in production:
stochastic-api: https://stochasticlab.cloud/shrtn.ink: https://app.shrtn.ink/
Hello world throughput is not the whole story, but the current branch lands in this range on a clean local run:
| Framework | Requests/sec | Avg Latency | Note |
|---|---|---|---|
| Tako | ~187,288 | ~505 us | latest local 30s rerun |
Tako + jemalloc |
~187,638 | ~502 us | latest local 30s rerun |
| Axum | ~186,194 | ~498 us | latest local 30s rerun |
| Actix | ~155,307 | ~635 us | latest local 30s rerun |
Command used: wrk -t4 -c100 -d30s http://127.0.0.1:8080/
Benchmarks are machine- and thermal-state-dependent, so treat these as local baselines, not universal claims. Axum and Actix were rerun with minimal temporary hello-world servers using the same wrk command.
Add Tako to your Cargo.toml:
[dependencies]
tako-rs = "1"Spin up a "Hello, World!" server in a handful of lines:
use anyhow::Result;
use tako::{
responder::Responder,
router::Router,
types::Request,
Method,
};
use tokio::net::TcpListener;
async fn hello_world(_: Request) -> impl Responder {
"Hello, World!".into_response()
}
#[tokio::main]
async fn main() -> Result<()> {
// Bind a local TCP listener
let listener = TcpListener::bind("127.0.0.1:8080").await?;
// Declare routes
let mut router = Router::new();
router.route(Method::GET, "/", hello_world);
// Launch the server
tako::serve(listener, router).await;
Ok(())
}MIT β see LICENSE for details.
Made with β€οΈ & π¦ by the Tako contributors.