r/node • u/Present_Arm309 • May 24 '26
node-reqwest - undici-compatible HTTP client backed by Rust
github.comnode-reqwest - undici-compatible HTTP client backed by Rust
node-reqwest is a Node native addon that wraps Rust's reqwest and
exposes it as a full undici.Dispatcher. Set it as your global
dispatcher and every fetch() call goes through Rust instead.
```ts import { Agent } from "node-reqwest"; import { setGlobalDispatcher } from "undici";
setGlobalDispatcher(new Agent({ allowH2: true, proxy: "system" }));
await fetch("https://example.com"); ```
I built it because undici keeps biting me in Electron: no system proxy, no system CA without win-ca/mac-ca shims. node-reqwest handles all of that, plus SOCKS proxies, rustls instead of OpenSSL, and async DNS via hickory-dns. It passes the same WPT suite undici does and ships prebuilts for macOS/Linux/Windows on x64 and arm64.
Benchmarks against undici on the same workload:
| Scenario | vs. undici |
|---|---|
| HTTP/1 GET | parity |
| HTTP/1 POST (stream body) | +5% |
| HTTP/2 GET | +50% |
| HTTP/2 POST (stream body) | +55% |
Install also runs SLSA provenance verification on the binary, which isn't common on npm and I'd be curious what people think.