Skip to main content

Crate rama

Crate rama 

Source
Expand description

🦙 rama (ラマ) is a modular service framework for building network services in Rust.

Rama is intentionally explicit: clients, servers, transports, protocols, middleware, and state are composed as services and layers. This keeps the shape of your network stack visible in code.

§Start here

§Main API areas

APIPurpose
Service, LayerCore service and middleware traits
httpHTTP clients, servers, services, layers, WebSockets, gRPC
proxyProxy primitives, SOCKS5, HAProxy PROXY protocol
tcp, udp, unixTransport listeners, connectors, and streams
tlsTLS abstractions, Rustls, BoringSSL, ACME
dnsDNS resolvers and related types
netNetwork addresses, sockets, forwarding, fingerprints
uaUser-Agent parsing, profiles, and emulation
telemetrytracing and OpenTelemetry integration
utilsUtilities, including Tower compatibility

§Common entry points

GoalAPI
Write a serviceService
Add middlewareLayer
Build an HTTP serverhttp::server
Route HTTP requestshttp::service::web
Build an HTTP clienthttp::client::EasyHttpWebClient
Use high-level client helpershttp::service::client::HttpClientExt
Build HTTP proxy flowshttp::proxy
Build SOCKS5 proxy flowsproxy::socks5
Build Linux transparent proxy flowslinux_tproxy_tcp.rs
Build Apple transparent proxy flowsffi/apple/examples/transparent_proxy

§Feature flags

The top-level rama crate is modular. Many modules are enabled through feature flags. The docs on docs.rs are built with all features enabled.

§More

Modules§

bytes
Re-export of bytes crate.
clicli and std
rama cli utilities
combinators
Combinators for working with or in function of services.
conversion
cryptocrypto and std
Crypto primitives and dependencies used by rama.
dnsdns and std
DNS support for Rama.
error
Error utilities for Rama and its users.
error_sink
A reusable sink for errors that occur in fire-and-forget contexts.
extensions
Extensions passed to and between services
futures
Re-export of the futures and asynk-strim crates.
gatewayfastcgi and std
Application server gateway protocols (FastCGI, and similar).
geo
Geographic identity types shared across rama.
gracefulstd
Shutdown management for graceful shutdown of async-first applications.
httphttp and std
rama http support
iostd
jsonstd
Streaming JSON tools for Rama.
layer
Layer type and utilities.
matcher
Matcher utilities for any middleware where need to match on incoming inputs.
netnet
proxyhaproxy and std, or proxy and std, or socks5 and std
rama proxy support
rtstd
Runtime utilities used by Rama.
service
Service type and utilities.
streamstd
tcpstd and tcp
TCP support for Rama.
telemetrystd
Rama telemetry modules.
tlsacme and std, or boring and std, or rustls and std, or std and tls
ttrpcttrpc
ttRPC (“gRPC for low-memory environments”) support.
uastd and ua
User Agent (UA) parser and profiles.
udpstd and udp
UDP module for Rama.
unixtarget_family=unix and unix
Unix (Domain) socket support for Rama.
username
Utilities to work with usernames and pull information out of it.
utils
utilities for rama

Structs§

ServiceInputstd
A generic service input that implements all rama traits conditionally

Traits§

Layer
A layer that produces a Layered service (middleware(inner service)).
Service
A Service that produces rama services, to serve given an input, be it transport layer Inputs or application layer http requests, or something else entirely.