🚀
H123
An experimental HTTP server in Rust that supports HTTP/1.1, HTTP/2, and HTTP/3 over QUIC.
Warning This is an experimental project and not intended for production uses.
📦
Getting started
🐳
Using Docker (recommended)
docker run \
-p 127.0.0.1:443:443/tcp \
-p 127.0.0.1:443:443/udp \
-v $(pwd)/htdocs:/htdocs \
ghcr.io/siketyan/h123:latest
Easy!
🏗
Classic style
- Clone this repository.
- Prepare your TLS server certificate, or use the default self-signed one.
- Run the server with the command:
cargo run -- -d ./htdocs -b 127.0.0.1:8443 --cert-chain-pem ./cert.pem --private-key-pem ./privkey.pem
- Boom! Your server is running.
🔌
API
This crate also exposes a Server API to serve your service easily in HTTP/1.1, HTTP/2, and HTTP/3. To use the API, implement Service<Request<Bytes>, Response = Response<Bytes>>
and call Server::new
.
pub struct Server<S, E> {
// ...
}
impl<S, E> Server<S, E> {
pub fn new<A>(config: &ServerConfig, bind_to: A, service: Arc<S>) -> Self
where
A: Into<SocketAddr> + Copy;
}
🔬
Internals
This server implementation is made from these protocol implementations:
- HTTP/1.1 and HTTP/2
- HTTP/3 over QUIC
📄
Licence
This repository is licenced under the Apache 2.0 Licence. For details, see LICENCE.md.
Copyright 2022 Naoki Ikeguchi <[email protected]>