TL;DR: Node-Fetch has no built-in proxy switch, so you wire an HTTP, HTTPS, or SOCKS5 agent into the request through its agent option. This guide walks through how to use a proxy in Node-Fetch end to end: authenticated HTTP and HTTPS proxies, SOCKS5, rotation, retries, TLS edge cases, troubleshooting, and the modern undici route for Node 18+ native fetch.If you have ever stared at a 403 from a target you used to scrape happily, you already know why this article exists. Learning how to use a proxy in Node-Fetch is the difference between a script that works on your laptop and one that survives in CI on a different IP, in a different country, against a real anti-bot stack. The good news: how to use a proxy in Node-Fetch boils down to one small API surface, and the rest is operational glue.
Node-Fetch is a popular HTTP client for Node.js that brings the browser's window.fetch style to the server. It is small, async, and pleasant to use, but it intentionally does not ship a proxy option. Instead, it exposes an agent slot, and you plug an external proxy agent into it. That single design choice is the mechanism behind every recipe below.
This guide is provider-neutral and code-first. You will set up an HTTP/HTTPS proxy, send your first proxied request, add credentials safely, switch to SOCKS5, rotate through a pool, add timeouts and retries, and verify traffic is actually leaving through the proxy. We will also cover the Node 18+ alternative using undici's ProxyAgent, plus a troubleshooting matrix for the errors you will hit on day one.




