XRAPH/Work/API gateway
Rust · since 2025

Octopus

A gateway in Rust that builds its own routing table. Services publish a FARP manifest carrying their OpenAPI, gRPC and GraphQL schemas; Octopus finds them over mDNS, Consul, Kubernetes or DNS and derives routes as instances appear and disappear. Static config works too, and the two modes run side by side.

Language
Rust
Category
API gateway
Since
2025
Stars
0
Repository Docs
01

Highlights

3 claims
H.01
Rust
On every request path

An async core on Tokio and Hyper with a trie router, connection pooling and scripts that run in microseconds. The tail latency is the product.

H.02
Fromschemas
Routes generated by FARP

Services publish OpenAPI, AsyncAPI, gRPC or GraphQL and the gateway turns them into routes as those services come and go.

H.03
Kubernetes-first
An in-process operator

The router is programmed from the Gateway API and Octopus CRDs, with probes, graceful drain, EndpointSlice discovery and cert-manager TLS.

02

What it does

8 entries

The edge for services that describe themselves, holding no routing state of its own.

02.1
Proxy

HTTP/1.1 and HTTP/2

Reverse proxying with connection pooling, configurable timeouts and WebSocket upgrades, plus gRPC and server-sent events.

WebSocketgRPC
Protocols
02.2
Routing

A trie with priorities

Wildcard path matching, method filtering, prefix rewriting and a per-route priority, resolved in the router instead of in a chain of guards.

Trie
02.3
Discovery

Schemas become routes

FARP watches services and generates routes from what they publish, with backends for mDNS, Consul, DNS and Kubernetes EndpointSlices. A static file of upstreams and routes still works, and the two modes compose.

FARP
FARP
02.4
Resilience

Balancing and health

Round-robin and weighted balancing with active health checks and circuit breaking, so a failing upstream stops receiving traffic before a person notices.

Circuit breaking
02.5
Security

Five ways to authenticate

JWT, OIDC, API key, forward-auth and mTLS, with role and scope authorisation or a Rhai or OPA policy, and TLS termination that hot-reloads certificates on the Kubernetes path.

mTLSOPA
Security
02.6
Extension

Rhai scripts and a plugin SDK

An embedded scripting engine for the behaviour that is one gateway’s own, and octopus-plugin-api for the behaviour worth compiling in.

Rhai
Plugins
02.7
Kubernetes

Gateway API and CRDs

An operator programs the router from HTTPRoute, GRPCRoute and Octopus CRDs, with health probes, graceful drain and a Helm chart.

Operator
Kubernetes
02.8
Observability

Metrics and an admin surface

Prometheus metrics and structured logging with a built-in dashboard and REST API. Distributed tracing is planned and not yet here.

Prometheus
Observability
03

Anatomy

4 modules
01

Controller

Watches FARP manifests as Kubernetes resources.

02

Router

Routes derived from manifests, never from gateway-side config.

03

Policy

Rate limits, auth and transforms applied at the edge.

04

Telemetry

Per-route metrics and traces out of the box.

04

Why it exists

Design notes

#What it is

Octopus is an API gateway in Rust that can build its own routing table. Most gateways expect every route declared by hand, in a repository owned by a different team than the service it points at. Services that speak FARP publish their own schemas across OpenAPI, AsyncAPI, gRPC and GraphQL, and Octopus turns those into routes as instances come and go.

It also runs purely statically from a config file, and the two modes work together: static routes for the things that will never be discoverable, derived routes for everything else.

#What it does

  • HTTP/1.1 and HTTP/2 reverse proxying with connection pooling, configurable timeouts and WebSocket upgrades.
  • A trie-based router with wildcard matching, method filtering, prefix stripping and per-route priorities.
  • Upstream load balancing (round-robin, weighted) with active health checks and circuit breaking.
  • Service discovery over mDNS, Consul, Kubernetes or DNS.
  • A middleware chain: request ids, CORS, JWT authentication, rate limiting, brotli/zstd/gzip compression, and inline Rhai scripting for the cases that need one-off logic.
  • TLS termination including mutual TLS, with hot certificate reload.
  • Prometheus metrics, OpenTelemetry and Jaeger tracing, structured JSON logs.
  • Layered YAML, JSON or TOML configuration with environment-variable substitution, supplied as several -c flags or a directory and merged in order.

#Why Rust here

A gateway is a single well-defined program with a hot path, no user-authored handlers in its type signatures, and a need for predictable memory use under load. That is the shape of problem Rust is best at, and it avoids the thing that killed my two Rust frameworks, since nobody has to read a generic signature to use it.

#Octopus or Bastion

Octopus when the gateway is genuinely a separate network element with its own scaling and blast radius, which usually means cluster ingress. Bastion when the gateway is a logical concern inside a Go process, such as an aggregation layer, a backend for frontend, or a service fronting three others. Same protocol, same derived routes.

05

Signals

GitHub
Stars
0
Language
Rust
Since
2025
Adopters
00

Shipping something on Octopus? Nobody is listed here yet. Tell me what you built and you will be the first.

Get listed