Skip to main content

What Is Actix Web

Actix Web is a web framework for building HTTP APIs and web applications in Rust. It provides routing, typed request data extraction, middleware, and an HTTP server. You write request handlers as async functions and use Rust types to read requests and build responses.

An Actix Web application compiles to a native executable with its own HTTP server. You can serve requests directly or put it behind a reverse proxy such as HAProxy or Caddy. Actix Web supports HTTP/1.1, HTTP/2, and TLS (HTTPS), and works with the Tokio async ecosystem.

What Can You Build With Actix Web?​

  • HTTP APIs: Read JSON, path parameters, and query strings with extractors, then return typed JSON responses.
  • Web applications: Handle forms, serve static files, and connect handlers to a database.
  • Real-time services: Use WebSockets for chat, notifications, and other applications that exchange messages over a persistent connection.

How an Application Works​

An App groups routes, middleware, and application state. The router matches an incoming request to a handler. Extractors read the data the handler needs, and the handler returns a value that can be converted into an HTTP response.

Middleware can inspect or change requests and responses. Use it for tasks such as logging and response compression. You can apply middleware to the whole application or to a scope of routes.

HttpServer runs the application and accepts connections. It provides configuration for worker threads, TLS, keep-alive connections, and graceful shutdown. Actix Web also provides test utilities for applications, handlers, and extractors.

Ecosystem Crates​

For features such as file uploads or sessions, add the relevant crate to your application:

The community crates page lists more integrations and extensions.

Relationship to the Actor Framework​

Actix Web was originally built on the actix actor framework, but has not depended on it since 2019. You do not need to use actors to build an Actix Web application.

Getting Started​

Actix Web runs on stable Rust. Follow the getting started guide to install the required tools and run your first server. For complete applications, browse the examples repository. Use the API documentation when you need details about a specific type or method.