undici is a high-performance HTTP/1.1 client built specifically for Node.js. It powers the nativeDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/nodejs/undici/llms.txt
Use this file to discover all available pages before exploring further.
fetch() implementation in Node.js v18+ and provides advanced APIs for connection pooling, pipelining, proxying, mocking, and more — giving you full control over your HTTP stack.
Quickstart
Get up and running with your first HTTP request in minutes
undici vs. fetch
Understand when to use the undici module vs. Node.js built-in fetch
API Reference
Explore all public APIs: request, fetch, dispatchers, and more
Guides
Proxy setup, mocking, caching, WebSocket, and testing guides
Why undici?
undici delivers exceptional HTTP performance through a purpose-built architecture that eliminates the overhead of Node.js’s built-inhttp module. Benchmarks show undici.request() achieving over 18,000 req/sec — more than 3x faster than alternatives like axios or request.
Connection Pooling
Efficient persistent connections with configurable pool sizes
HTTP Pipelining
Send multiple requests over a single connection for maximum throughput
Interceptors
Compose caching, retry, redirect, and DNS interceptors declaratively
Proxy Support
HTTP, HTTPS, SOCKS5, and environment-based proxy configuration
Mocking
Intercept and mock HTTP requests for testing without real servers
Web APIs
WebSocket, EventSource, CacheStorage, and Cookies support
Get started
Performance comparison
undici consistently outperforms other HTTP clients in Node.js benchmarks:| Client | Requests/sec | vs. slowest |
|---|---|---|
| axios | 5,708 | baseline |
| node-fetch | 5,945 | +4% |
| undici fetch | 5,903 | +3% |
| undici stream | 18,245 | +220% |
| undici request | 18,340 | +221% |
| undici dispatch | 22,234 | +289% |
Benchmarks run with 50 TCP connections and pipelining depth of 10 on Node.js 22.11.0. Results will vary by workload.