40 releases (3 stable)

2.0.0 Sep 11, 2020
2.0.0-beta.3 Aug 14, 2020
2.0.0-beta.2 Jul 22, 2020
2.0.0-alpha.2 Mar 7, 2020
0.1.0-alpha.2 Mar 30, 2019

#14 in HTTP server

Download history 19283/week @ 2020-05-29 23261/week @ 2020-06-05 23056/week @ 2020-06-12 22956/week @ 2020-06-19 24664/week @ 2020-06-26 23973/week @ 2020-07-03 24158/week @ 2020-07-10 23960/week @ 2020-07-17 20929/week @ 2020-07-24 22204/week @ 2020-07-31 23344/week @ 2020-08-07 24049/week @ 2020-08-14 24972/week @ 2020-08-21 25420/week @ 2020-08-28 23706/week @ 2020-09-04 28975/week @ 2020-09-11

101,583 downloads per month
Used in 249 crates (52 directly)

MIT/Apache

660KB
16K SLoC

Actix http Build Status codecov crates.io Join the chat at https://gitter.im/actix/actix

Actix http

Documentation & community resources

Example

// see examples/framed_hello.rs for complete list of used crates.
use std::{env, io};

use actix_http::{HttpService, Response};
use actix_server::Server;
use futures::future;
use http::header::HeaderValue;
use log::info;

#[actix_rt::main]
async fn main() -> io::Result<()> {
    env::set_var("RUST_LOG", "hello_world=info");
    env_logger::init();

    Server::build()
        .bind("hello-world", "127.0.0.1:8080", || {
            HttpService::build()
                .client_timeout(1000)
                .client_disconnect(1000)
                .finish(|_req| {
                    info!("{:?}", _req);
                    let mut res = Response::Ok();
                    res.header("x-head", HeaderValue::from_static("dummy value!"));
                    future::ok::<_, ()>(res.body("Hello world!"))
                })
                .tcp()
        })?
        .run()
        .await
}

License

This project is licensed under either of

at your option.

Code of Conduct

Contribution to the actix-http crate is organized under the terms of the Contributor Covenant, the maintainer of actix-http, @fafhrd91, promises to intervene to uphold that code of conduct.

Dependencies

~15–21MB
~490K SLoC