๐Ÿ™ Tako

April 30, 2026 ยท View on GitHub

Build Workflow Crates.io License

โš ๏ธ Tako 2.0 is in progress on main. The default branch carries breaking changes (new Server::builder, Router::with_state, nest/scope, 405 + Allow, RFC 7807 problem+json, runtime-agnostic ServerHandle, โ€ฆ) that are not yet released. For production, install the published 1.x line from crates.io:

[dependencies]
tako-rs = "1"

Track 2.0 work in V2_ROADMAP.md. Expect API churn until the 2.0 alpha is tagged.

๐Ÿ™ Tako โ€” Multi-Transport Rust Framework for Modern Network Services

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.

Why Tako

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.

โœจ Highlights

  • 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 utoipa or vespera, GraphiQL support, and a growing example suite for common deployment patterns.

Best Fit

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.

Feature Matrix

Transports & Protocols

ProtocolTokioCompioFeature 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

Extractors (22+)

ExtractorDescription
Json<T>JSON body (with optional SIMD acceleration)
Form<T>URL-encoded form body
Query<T>URL query parameters
Path<T>Route path parameters
ParamsDynamic path params map
HeaderMapFull request headers
BytesRaw request body
State<T>Shared application state
CookieJarCookie reading/writing
SignedCookieJarHMAC-signed cookies
PrivateCookieJarEncrypted cookies
BasicAuthHTTP Basic authentication
BearerAuthBearer token extraction
JwtClaims<T>JWT token validation & claims
ApiKeyAPI key from header/query
AcceptContent negotiation
AcceptLanguageLanguage negotiation
RangeHTTP Range header
IpAddrClient IP address
Protobuf<T>Protocol Buffers body
SimdJson<T>Force SIMD JSON parsing
MultipartMultipart form data

Middleware

MiddlewareDescription
JWT AuthValidate JWT tokens on routes
Basic AuthHTTP Basic authentication
Bearer AuthBearer token validation
API Key AuthHeader or query-based API key
CSRFDouble-submit cookie CSRF protection
SessionCookie-based sessions (in-memory store)
Security HeadersHSTS, X-Frame-Options, CSP, etc.
Request IDGenerate/propagate X-Request-ID
Body LimitEnforce max request body size
Upload ProgressTrack upload progress callbacks
CORSCross-Origin Resource Sharing
Rate LimiterToken-bucket rate limiting
CompressionBrotli / gzip / deflate / zstd
IdempotencyIdempotency key deduplication
MetricsPrometheus / OpenTelemetry export

Feature Flags

FlagDescription
http2HTTP/2 support (ALPN h2)
http3HTTP/3 over QUIC (enables webtransport)
tlsHTTPS via rustls
compioCompio async runtime (alternative to tokio)
compio-tlsTLS on compio
compio-wsWebSocket on compio
grpcgRPC unary RPCs with protobuf
protobufProtobuf extractor (prost)
pluginsCORS, compression, rate limiting
simdSIMD JSON parsing (sonic-rs + simd-json)
multipartMultipart form-data extractors
file-streamFile streaming & range requests
async-graphqlGraphQL integration
graphiqlGraphiQL IDE endpoint
signalsIn-process pub/sub signal system
jemallocjemalloc global allocator
zstdZstandard compression (in plugins)
tako-tracingDistributed tracing subscriber
utoipaOpenAPI docs via utoipa
vesperaOpenAPI docs via vespera
metrics-prometheusPrometheus metrics export
metrics-opentelemetryOpenTelemetry metrics export
zero-copy-extractorsZero-copy body extraction
clientOutbound HTTP client

Documentation

API Documentation

MSRV 1.87.0 | Edition 2024

Tako in Production

Tako already powers real-world services in production:

Baseline Hello World Benchmark

Hello world throughput is not the whole story, but the current branch lands in this range on a clean local run:

FrameworkRequests/secAvg LatencyNote
Tako~187,288~505 uslatest local 30s rerun
Tako + jemalloc~187,638~502 uslatest local 30s rerun
Axum~186,194~498 uslatest local 30s rerun
Actix~155,307~635 uslatest 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.

๐Ÿ“ฆ Installation

Add Tako to your Cargo.toml:

[dependencies]
tako-rs = "1"

๐Ÿš€ Quick Start

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(())
}

๐Ÿ“œ License

MIT โ€” see LICENSE for details.

Made with โค๏ธ & ๐Ÿฆ€ by the Tako contributors.