35 releases (2 stable)

✓ Uses Rust 2018 edition

2.0.0-alpha.4 May 21, 2020
2.0.0-alpha.2 Mar 7, 2020
1.0.1 Dec 20, 2019
0.3.0-alpha.2 Dec 2, 2019
0.1.0-alpha.2 Mar 30, 2019

#4 in HTTP server

Download history 18848/week @ 2020-03-16 20134/week @ 2020-03-23 19834/week @ 2020-03-30 18851/week @ 2020-04-06 18351/week @ 2020-04-13 20197/week @ 2020-04-20 20274/week @ 2020-04-27 18850/week @ 2020-05-04 20363/week @ 2020-05-11 18754/week @ 2020-05-18 17701/week @ 2020-05-25 21916/week @ 2020-06-01 21525/week @ 2020-06-08 22934/week @ 2020-06-15 23872/week @ 2020-06-22 23281/week @ 2020-06-29

82,436 downloads per month
Used in 223 crates (54 directly)

MIT/Apache and maybe MPL-2.0

770KB
18K 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–20MB
~489K SLoC