#actix #http #web #framework #async

actix-web

Actix Web is a powerful, pragmatic, and extremely fast web framework for Rust

126 releases (19 stable)

new 4.0.0-beta.20 Jan 14, 2022
4.0.0-beta.18 Dec 29, 2021
4.0.0-beta.13 Nov 30, 2021
4.0.0-beta.8 Jun 26, 2021
0.2.1 Nov 3, 2017

#1 in WebSocket

Download history 60000/week @ 2021-09-27 61695/week @ 2021-10-04 66297/week @ 2021-10-11 66892/week @ 2021-10-18 56934/week @ 2021-10-25 55291/week @ 2021-11-01 58264/week @ 2021-11-08 65048/week @ 2021-11-15 58120/week @ 2021-11-22 73844/week @ 2021-11-29 78941/week @ 2021-12-06 80837/week @ 2021-12-13 58218/week @ 2021-12-20 41654/week @ 2021-12-27 70978/week @ 2022-01-03 78314/week @ 2022-01-10

254,140 downloads per month
Used in 507 crates (467 directly)

MIT/Apache

1.5MB
36K SLoC

Actix Web

Actix Web is a powerful, pragmatic, and extremely fast web framework for Rust

crates.io Documentation MSRV MIT or Apache 2.0 licensed Dependency Status
CI codecov downloads Chat on Discord

Features

  • Supports HTTP/1.x and HTTP/2
  • Streaming and pipelining
  • Keep-alive and slow requests handling
  • Client/server WebSockets support
  • Transparent content compression/decompression (br, gzip, deflate, zstd)
  • Powerful request routing
  • Multipart streams
  • Static assets
  • SSL support using OpenSSL or Rustls
  • Middlewares (Logger, Session, CORS, etc)
  • Includes an async HTTP client
  • Runs on stable Rust 1.54+

Documentation

Example

Dependencies:

[dependencies]
actix-web = "3"

Code:

use actix_web::{get, web, App, HttpServer, Responder};

#[get("/{id}/{name}/index.html")]
async fn index(web::Path((id, name)): web::Path<(u32, String)>) -> impl Responder {
    format!("Hello {}! id:{}", name, id)
}

#[actix_web::main]
async fn main() -> std::io::Result<()> {
    HttpServer::new(|| App::new().service(index))
        .bind("127.0.0.1:8080")?
        .run()
        .await
}

More examples

You may consider checking out this directory for more examples.

Benchmarks

One of the fastest web frameworks available according to the TechEmpower Framework Benchmark.

License

This project is licensed under either of

at your option.

Code of Conduct

Contribution to the actix-web repo is organized under the terms of the Contributor Covenant. The Actix team promises to intervene to uphold that code of conduct.

Dependencies

~22MB
~518K SLoC