#http #https #web #server

axum-server

High level server designed to be used with axum framework

6 releases

new 0.2.3 Sep 13, 2021
0.2.2 Sep 6, 2021
0.2.1 Aug 30, 2021
0.1.2 Aug 24, 2021
0.0.0 Aug 20, 2021

#583 in Network programming

Download history 212/week @ 2021-08-18 330/week @ 2021-08-25 782/week @ 2021-09-01 850/week @ 2021-09-08

715 downloads per month

MIT license

73KB
1.5K SLoC

License Docs - Master Docs - Stable

axum-server

axum-server is a hyper server implementation designed to be used with axum framework.

Features

  • Conveniently bind to any number of addresses.
  • Tls support through rustls. Only pem format is supported.
  • Reload tls while server is running.
  • Access to client ip address from services/handlers.
  • Record incoming and outgoing bytes for each connection.
  • Services created by axum can directly be served.
  • Although designed to be used with axum, any Service that implements Clone can be served.

Usage example

axum "Hello, World!" example can be run like:

use axum::{
    handler::get,
    Router,
};

#[tokio::main]
async fn main() {
    let app = Router::new().route("/", get(|| async { "Hello, World!" }));

    axum_server::bind("127.0.0.1:3000")
        .serve(app)
        .await
        .unwrap();
}

Safety

This crate uses #![forbid(unsafe_code)] to ensure everything is implemented in 100% safe Rust.

License

This project is licensed under the MIT license.

Dependencies

~7–11MB
~206K SLoC