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.
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!
- 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.
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;
}
This server implementation is made from these protocol implementations:
- HTTP/1.1 and HTTP/2
- HTTP/3 over QUIC
This repository is licenced under the Apache 2.0 Licence. For details, see LICENCE.md.
Copyright 2022 Naoki Ikeguchi <me@s6n.jp>