In the pursuit of ultimate performance in Rust backend development, Hyperlane stands out with its lightweight design, pure Rust implementation, and high throughput. Hyperlane is a zero-dependency, pure Rust HTTP service library built on the Tokio asynchronous runtime, offering a unified cross-platform API experience. It supports not only standard HTTP requests and responses but also includes built-in support for WebSocket, Server-Sent Events (SSE), and a flexible middleware system — making it ideal for building modern, high-concurrency Web APIs and real-time applications. Core Features of Hyperlane Pure Rust & Zero Dependencies: Built entirely in Rust using only the standard library and the Tokio runtime. Hyperlane requires no additional system bindings, ensuring consistent behavior across Windows, Linux, and macOS. Cross-Platform Compatibility & Unified API: Write once, deploy anywhere — no platform-specific adjustments required. High Performance Design: With a minimalist architecture and memory-efficient data structures, Hyperlane reduces processing overhead. Benchmark results show performance close to bare-metal Tokio implementations. Asynchronous Multiplexing (Tokio): Leverages Tokio's async runtime to make full use of multi-core CPUs, efficiently handling high concurrency. Flexible Middleware: Supports both request and response middleware, allowing developers to plug in logic at different stages (e.g., logging, authentication, custom headers). Multi-Protocol Support: In addition to HTTP, Hyperlane natively supports WebSocket and SSE, simplifying the development of push-based or real-time communication systems. Thanks to these features, Hyperlane shines in use cases such as API services, microservices, IoT, and game backends — offering excellent concurrency handling while maintaining a clean and efficient developer experience. Getting Started: Incredibly Simple Hyperlane is designed for a smooth onboarding experience. You can add it to your project with a single command: cargo add hyperlane # Install Hyperlane As the official documentation puts it: "Adding Hyperlane to your Rust project is a breeze. Simply run: cargo add hyperlane." After adding the dependency, you're ready to start building. Hyperlane offers comprehensive examples and documentation (linked below), allowing you to quickly spin up your first HTTP server. Here’s a typical Hyperlane example, demonstrating server configuration, middleware, routing, and WebSocket usage: use hyperlane::*; async fn request_middleware(ctx: Context) { let socket_addr: String = ctx.get_socket_addr_or_default_string().await; ctx.set_response_header(SERVER, HYPERLANE) .await .set_response_header(CONNECTION, CONNECTION_KEEP_ALIVE) .await .set_response_header(CONTENT_TYPE, TEXT_PLAIN) .await .set_response_header("SocketAddr", socket_addr) .await; } async fn response_middleware(ctx: Context) { let _ = ctx.send().await; } async fn root_route(ctx: Context) { ctx.set_response_status_code(200) .await .set_response_body("Hello hyperlane => /") .await; } async fn websocket_route(ctx: Context) { let request_body: Vec = ctx.get_request_body().await; let _ = ctx.send_response_body(request_body).await; } fn error_handle(error: String) { eprintln!("{}", error); let _ = std::io::Write::flush(&mut std::io::stderr()); } #[tokio::main] async fn main() { let server: Server = Server::new(); server.host("0.0.0.0").await; server.port(60000).await; server.enable_nodelay().await; server.disable_linger().await; server.http_line_buffer_size(4096).await; server.websocket_buffer_size(4096).await; server.error_handle(error_handle).await; server.request_middleware(request_middleware).await; server.response_middleware(response_middleware).await; server.route("/", root_route).await; server.route("/websocket", websocket_route).await; server .route("/test/:text", move |ctx: Context| async move { let param: RouteParams = ctx.get_route_params().await; panic!("Test panic {:?}", param); }) .await; server.run().await.unwrap(); } In this example: Middleware: request_middleware adds custom headers like Server, Date, and client socket address. response_middleware logs both the request and response after sending. Routing: Defines a root route / that returns a greeting, and a /websocket route that echoes client input. Dynamic Routing: Demonstrates /test/:text with path parameter parsing via ctx.get_route_params().await. Server Configuration: Configures host, port, logging, buffer sizes, and more, showcasing Hyperlane’s clean and expressive API. This sample clearly demonstrates Hyperlane’s intuitive API and powerful features. Developers can achieve common tasks easily without dealing with low-level details. Performance

In the pursuit of ultimate performance in Rust backend development, Hyperlane stands out with its lightweight design, pure Rust implementation, and high throughput. Hyperlane is a zero-dependency, pure Rust HTTP service library built on the Tokio asynchronous runtime, offering a unified cross-platform API experience. It supports not only standard HTTP requests and responses but also includes built-in support for WebSocket, Server-Sent Events (SSE), and a flexible middleware system — making it ideal for building modern, high-concurrency Web APIs and real-time applications.
Core Features of Hyperlane
- Pure Rust & Zero Dependencies: Built entirely in Rust using only the standard library and the Tokio runtime. Hyperlane requires no additional system bindings, ensuring consistent behavior across Windows, Linux, and macOS.
- Cross-Platform Compatibility & Unified API: Write once, deploy anywhere — no platform-specific adjustments required.
- High Performance Design: With a minimalist architecture and memory-efficient data structures, Hyperlane reduces processing overhead. Benchmark results show performance close to bare-metal Tokio implementations.
- Asynchronous Multiplexing (Tokio): Leverages Tokio's async runtime to make full use of multi-core CPUs, efficiently handling high concurrency.
- Flexible Middleware: Supports both request and response middleware, allowing developers to plug in logic at different stages (e.g., logging, authentication, custom headers).
- Multi-Protocol Support: In addition to HTTP, Hyperlane natively supports WebSocket and SSE, simplifying the development of push-based or real-time communication systems.
Thanks to these features, Hyperlane shines in use cases such as API services, microservices, IoT, and game backends — offering excellent concurrency handling while maintaining a clean and efficient developer experience.
Getting Started: Incredibly Simple
Hyperlane is designed for a smooth onboarding experience. You can add it to your project with a single command:
cargo add hyperlane # Install Hyperlane
As the official documentation puts it:
"Adding Hyperlane to your Rust project is a breeze. Simply run: cargo add hyperlane
."
After adding the dependency, you're ready to start building. Hyperlane offers comprehensive examples and documentation (linked below), allowing you to quickly spin up your first HTTP server.
Here’s a typical Hyperlane example, demonstrating server configuration, middleware, routing, and WebSocket usage:
use hyperlane::*;
async fn request_middleware(ctx: Context) {
let socket_addr: String = ctx.get_socket_addr_or_default_string().await;
ctx.set_response_header(SERVER, HYPERLANE)
.await
.set_response_header(CONNECTION, CONNECTION_KEEP_ALIVE)
.await
.set_response_header(CONTENT_TYPE, TEXT_PLAIN)
.await
.set_response_header("SocketAddr", socket_addr)
.await;
}
async fn response_middleware(ctx: Context) {
let _ = ctx.send().await;
}
async fn root_route(ctx: Context) {
ctx.set_response_status_code(200)
.await
.set_response_body("Hello hyperlane => /")
.await;
}
async fn websocket_route(ctx: Context) {
let request_body: Vec<u8> = ctx.get_request_body().await;
let _ = ctx.send_response_body(request_body).await;
}
fn error_handle(error: String) {
eprintln!("{}", error);
let _ = std::io::Write::flush(&mut std::io::stderr());
}
#[tokio::main]
async fn main() {
let server: Server = Server::new();
server.host("0.0.0.0").await;
server.port(60000).await;
server.enable_nodelay().await;
server.disable_linger().await;
server.http_line_buffer_size(4096).await;
server.websocket_buffer_size(4096).await;
server.error_handle(error_handle).await;
server.request_middleware(request_middleware).await;
server.response_middleware(response_middleware).await;
server.route("/", root_route).await;
server.route("/websocket", websocket_route).await;
server
.route("/test/:text", move |ctx: Context| async move {
let param: RouteParams = ctx.get_route_params().await;
panic!("Test panic {:?}", param);
})
.await;
server.run().await.unwrap();
}
In this example:
-
Middleware:
request_middleware
adds custom headers likeServer
,Date
, and client socket address.response_middleware
logs both the request and response after sending. -
Routing: Defines a root route
/
that returns a greeting, and a/websocket
route that echoes client input. -
Dynamic Routing: Demonstrates
/test/:text
with path parameter parsing viactx.get_route_params().await
. - Server Configuration: Configures host, port, logging, buffer sizes, and more, showcasing Hyperlane’s clean and expressive API.
This sample clearly demonstrates Hyperlane’s intuitive API and powerful features. Developers can achieve common tasks easily without dealing with low-level details.
Performance Benchmark Comparison
Hyperlane is known for its stellar performance. In official benchmarks, it performs second only to raw Tokio implementations, significantly outperforming many popular frameworks. For example, under a 60-second wrk
load test with 360 concurrent connections, the QPS (requests per second) results are:
-
wrk test:
- Tokio: 340,130.92
- Hyperlane: 324,323.71
- Rocket: 298,945.31
- Rust Std: 291,218.96
- Gin: 242,570.16
- Go Std: 234,178.93
- Node.js: 139,412.13
-
ab test:
- Tokio: 308,596.26
- Hyperlane: 307,568.90
- Rocket: 267,931.52
- Rust Std: 260,514.56
- Go Std: 226,550.34
- Gin: 224,296.16
- Node.js: 85,357.18
These results demonstrate Hyperlane’s exceptional performance under heavy concurrency, outperforming Rocket, Gin, and Node.js. With throughput in the hundreds of thousands of requests per second, it easily meets the performance needs of most services — all while benefiting from Rust’s memory safety and type safety.
Summary & Resources
Hyperlane combines pure Rust, Tokio-level concurrency, multi-protocol support, developer-friendly APIs, and top-tier performance — making it a premium choice for building high-performance web services. For use cases demanding extreme speed and reliability, Hyperlane offers a faster alternative to Rocket, Actix, and other frameworks. Give it a try and don’t forget to star the repo!
- GitHub Repository: https://github.com/eastspire/hyperlane
- Official Docs: https://docs.rs/hyperlane/latest/hyperlane/
- Quick Start Example: https://github.com/eastspire/hyperlane-quick-start
All data and insights are sourced from official documentation and performance benchmarks. Hyperlane is available on crates.io and can be added via cargo add hyperlane
. Try it out and experience the power and simplicity of Hyperlane today!