framework for composable networking services
Find a file
2026-11-01 14:54:46 +01:00
.github Attempt to fix docs.rs build 2026-10-30 12:03:25 +01:00
docs web: Make request-target validation and normalization opt-in 2026-10-31 21:20:13 +01:00
ntex web: Make request-target validation and normalization opt-in 2026-10-31 21:20:13 +01:00
ntex-bytes Keep fatal signal handlers minimal to avoid hangs when another thread aborts or faults. 2026-10-27 15:40:11 +01:00
ntex-codec Prep codec release (#1065) 2026-10-01 09:17:18 +02:00
ntex-dispatcher Forward bind for inner services 2026-10-31 15:49:47 +01:00
ntex-error Add IoMetrics, per-thread I/O statistics: read and write backpressure counts, active connections and connection-time under backpressure, bytes held in read and write buffers. Connections report to IoMetrics::current() of the thread they were created on 2026-10-17 09:48:11 +05:00
ntex-http web: Honour 'q' values in 'Accept-Encoding' in the 'Compress' middleware 2026-10-09 08:29:02 +02:00
ntex-io Add QueryItem::into_inner() to take ownership of the query result 2026-11-01 14:54:46 +01:00
ntex-macros Replace syn with unsynn 2026-10-10 11:19:52 +02:00
ntex-net Various spawn related improvements 2026-10-28 10:26:00 +01:00
ntex-router Prepare releases 2026-10-04 22:32:59 +02:00
ntex-rt Native tasks cleanups (#1160) 2026-10-29 23:12:43 +01:00
ntex-server Update api docs and tests (#1157) 2026-10-27 23:06:56 +01:00
ntex-service Rename ServiceBinding to ReadyBinding and ServiceBindingMiddleware to ReadyBindingMiddleware 2026-10-31 15:49:47 +01:00
ntex-tls Add QueryItem::into_inner() to take ownership of the query result 2026-11-01 14:54:46 +01:00
ntex-util Rename ServiceBinding to ReadyBinding and ServiceBindingMiddleware to ReadyBindingMiddleware 2026-10-31 15:49:47 +01:00
urly web: Make request-target validation and normalization opt-in 2026-10-31 21:20:13 +01:00
.gitignore Refresh GitHub workflows (#337) 2024-04-07 22:42:16 +05:00
Cargo.toml Add QueryItem::into_inner() to take ownership of the query result 2026-11-01 14:54:46 +01:00
codecov.yml Ignore async-std tests 2022-02-01 07:04:18 +06:00
LICENSE-APACHE Update license 2024-01-08 21:32:26 +06:00
LICENSE-MIT Update license 2024-01-08 21:32:26 +06:00
README.md Fix guide redirect page 2026-10-09 12:10:58 +02:00
rustfmt.toml Pipeline state management (#972) 2026-08-18 09:34:26 +02:00

ntex

Framework for composable network services.

Linux crates.io Documentation MSRV License codecov Discord

ntex provides a strongly typed component for building asynchronous network applications. It includes HTTP/1, HTTP/2, WebSocket, TLS, and runtime-independent I/O support. MQTT, AMQP, and gRPC are provided by related projects.

Build status

Platform Status
Linux Linux
macOS macOS
Windows Windows

Usage

Add ntex to your project:

[dependencies]
ntex = "4"

A minimal web server looks like this:

use ntex::{SharedCfg, web};

#[web::get("/")]
async fn index() -> &'static str {
    "Hello world!"
}

#[ntex::main]
async fn main() -> std::io::Result<()> {
    web::HttpServer::new(async |_| web::App::new().service(index))
        .bind("127.0.0.1:8080", SharedCfg::new("hello-world"))?
        .run()
        .await
}

Runtime selection

Without an explicit runtime feature, ntex uses its native single-threaded runtime and automatically selects a platform I/O reactor:

  • Linux tries io_uring and falls back to polling.
  • Other Unix platforms use polling.
  • Windows uses IOCP.

Alternative runtimes and native reactors can be selected with Cargo features:

Feature Runtime or reactor
tokio Tokio local runtime and I/O driver
compio Compio runtime and completion-based I/O
neon-polling Native runtime with the polling reactor on Unix
neon-uring Native runtime with io_uring on Linux

Enable at most one runtime or native-reactor selection feature. For example:

[dependencies]
ntex = { version = "4", features = ["tokio"] }

Optional features

  • openssl and rustls enable the corresponding TLS integrations.
  • compress enables HTTP content compression (gzip, deflate and zstd).
  • cookie enables cookie support.
  • ws enables WebSocket APIs and is enabled by default.
Project Description
ntex-mqtt Client and server framework for MQTT v5 and v3.1.1
ntex-amqp Client and server framework for AMQP 1.0
ntex-grpc Client and server framework for gRPC

Documentation and community

License

This project is licensed under either of: