oxihttp — The COOLJAPAN Pure-Rust HTTP facade
oxihttp is the top-level façade for the OxiHTTP stack. A single dependency gives you a complete, Pure-Rust HTTP client and server, with a unified type surface re-exported from oxihttp-core, oxihttp-client, and oxihttp-server. Feature flags compose the stack: client and server are on by default; TLS, compression, WebSockets, Server-Sent Events, Tower integration, SOCKS5, and HTTP/3 are opt-in.
The entire stack is Pure Rust — no OpenSSL, no C/C++ libraries. TLS is provided by oxitls + rustls, compression by oxiarc-deflate, and HTTP/3 by oxiquic-h3. The crate is #![forbid(unsafe_code)], and ships a reqwest → OxiHTTP migration guide in its migration module.
Installation
[]
# Client + server (defaults)
= "0.1.0"
# Client only
= { = "0.1.0", = false, = ["client"] }
# Server only
= { = "0.1.0", = false, = ["server"] }
# With HTTPS (client + server TLS)
= { = "0.1.0", = ["tls"] }
# Everything
= { = "0.1.0", = ["all"] }
Quick Start
Client
# async
Server
use ;
# async
One-shot helpers
# async
Top-level entry points
Client functions (feature client)
| Function | Description |
|---|---|
get(url) |
One-shot GET with a temporary default client |
post(url, body) |
One-shot POST |
put(url, body) |
One-shot PUT |
delete(url) |
One-shot DELETE |
For repeated requests, build and reuse a Client via Client::builder().
Misc
| Item | Description |
|---|---|
version() -> &'static str |
Crate version at runtime |
Result<T> |
Alias for Result<T, OxiHttpError> |
Error |
Alias for OxiHttpError |
Request |
Re-export of http::Request |
RawResponse |
Re-export of http::Response (the raw http type) |
Re-exported types at crate root
From oxihttp-core (always available)
Body, PinnedBody, Bytes, BytesMut, ContentType, Cookie, CookieJar, SameSite, FormBody, MultipartBuilder, MultipartPart, HeaderMap, HeaderName, HeaderValue, HeaderMapExt, Method, StatusCode, Uri, UriExt, Version, OxiHttpError.
From oxihttp-client (feature client)
Client, ClientBuilder, RequestBuilder, Response, BodyStream, RedirectPolicy, RetryPolicy.
With feature tls: HttpsClient, OxiHttpsConnector, MaybeHttpsStream, RequestTlsConfig.
From oxihttp-server (feature server)
Server, ServerBuilder, Router, ServerRequest (the server's Request), CorsConfig, RateLimiter, and the response helper module.
With features tls + server: TlsConfig.
Module map
| Module | Feature | Contents |
|---|---|---|
oxihttp::response |
server |
Response builders (text_response, json_response, …) |
oxihttp::tls |
tls + server |
TlsConfig, PeerCertInfo |
oxihttp::ws |
websocket |
upgrade, WebSocket, WebSocketUpgrade, Message, CloseFrame |
oxihttp::middleware |
tower |
Client ClientMiddleware/LoggingMiddleware/TimingMiddleware; server LoggingLayer/RequestIdLayer |
oxihttp::h3 |
h3 |
H3Connection, H3ConnectionBuilder, H3Server, H3Request, H3Response |
oxihttp::migration |
— | reqwest → OxiHTTP migration guide (docs only) |
oxihttp::prelude |
— | The most common types (see below) |
Prelude
use *;
Imports Bytes, HeaderMap, HeaderValue, Method, StatusCode, Uri, OxiHttpError, Result; plus Client and Response (feature client) and Router and Server (feature server).
Feature Flags
| Feature | Default | Enables |
|---|---|---|
client |
✓ | HTTP client (pooling, redirects, retries) via oxihttp-client |
server |
✓ | HTTP server (routing, middleware, graceful shutdown) via oxihttp-server |
tls |
✗ | HTTPS client and server TLS via oxitls/rustls (implies client) |
compression |
✗ | Server response compression (implies server) |
decompression |
✗ | Client auto-decompression (implies client) |
static-files |
✗ | ServeDir/ServeFile static serving (implies server) |
sse |
✗ | Server-Sent Events (implies server) |
tower |
✗ | Tower middleware integration (implies server) |
websocket |
✗ | RFC 6455 WebSocket (implies server) |
socks |
✗ | SOCKS5 proxy client support (implies client) |
h3 |
✗ | HTTP/3 client + server via oxiquic-h3 (implies client + server) |
all |
✗ | All of the above |
Migration from reqwest
The oxihttp::migration module documents how common reqwest patterns map onto OxiHTTP — client setup, GET/POST, JSON bodies, headers, and timeouts — to ease porting existing code to the Pure-Rust stack.
Architecture
OxiHTTP is layered:
oxihttp (this facade)
/ \
oxihttp-client oxihttp-server
\ /
oxihttp-core (shared types: Body, OxiHttpError, headers, cookies, …)
oxihttp-core— foundational types shared by every layer.oxihttp-client— the HTTP client implementation.oxihttp-server— the HTTP server implementation.
License
Apache-2.0 — COOLJAPAN OU (Team Kitasan)