waygate
waygate is a modern HTTP client for Rust. It focuses on predictable behaviour, a clean async API, and a design that can grow with services, CLIs, and libraries.
This repository currently contains an early 0.1.0 release of the library.
Status
The 0.1.0 release is intentionally small and focused:
- Core client and HTTP types are defined.
- A generic client type can be backed by different HTTP implementations.
- A mock backend is available for fast, deterministic tests.
- A hyper-based backend is available for real HTTP/1.1 and HTTP/2 traffic on Tokio.
Streaming bodies and more advanced configuration options are planned but not yet implemented in this release.
Features
- Async client built on top of Tokio and hyper.
- Backend abstraction so the same client API can be used with different HTTP stacks.
- Mock client for unit and integration tests that do not need real network calls.
- Hyper-backed client for real HTTP requests.
- Simple configuration structure for basic timeouts and redirect limits.
- Unified error type with clear variants for configuration and transport problems.
Installation
Add the crate to your Cargo.toml:
[]
= "0.1.0"
Then import it in your code:
use HyperClient;
Quickstart
The example below performs a simple GET request using the hyper-backed client.
use Uri;
use HyperClient;
async
For tests or local development, you can use the mock client:
use ;
use ;
async
Configuration
The client exposes a simple configuration structure that can be adjusted as needed:
use Duration;
use Uri;
use HyperClient;
async
As the library evolves, this configuration will grow to cover more advanced behaviour such as retry policies and redirect handling.
Roadmap
Planned areas of improvement include:
- Streaming request and response bodies.
- Richer configuration (retries, redirects, connection pooling controls).
- Additional backend implementations.
- More examples and stronger documentation.
For a more detailed view of the direction and milestones, see plan.md in the repository root.
License
This project is distributed under the terms of the license found in the LICENSE file.