33 releases (2 stable)

✓ Uses Rust 2018 edition

2.0.0-alpha.2 Mar 7, 2020
1.0.1 Dec 20, 2019
0.3.0-alpha.2 Dec 2, 2019
0.3.0-alpha.1 Nov 22, 2019
0.1.0-alpha.2 Mar 30, 2019

#9 in HTTP server

Download history 19692/week @ 2019-12-10 15625/week @ 2019-12-17 10095/week @ 2019-12-24 11335/week @ 2019-12-31 19318/week @ 2020-01-07 17931/week @ 2020-01-14 18833/week @ 2020-01-21 19744/week @ 2020-01-28 20789/week @ 2020-02-04 18116/week @ 2020-02-11 19203/week @ 2020-02-18 18126/week @ 2020-02-25 21305/week @ 2020-03-03 19503/week @ 2020-03-10 19506/week @ 2020-03-17 18281/week @ 2020-03-24

75,198 downloads per month
Used in 191 crates (46 directly)

MIT/Apache and MPL-2.0 licenses

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
~485K SLoC