If you're fetching data at scale, you know that Cloudflare and Datadome are the premiere anti-bot firewalls today that block your fetch/axios (i.e. programmatic) requests, even with the correct browser headers. Particularly annoying if you're trying to build a corpus of webpages, as this will leave your model summarizing HTTP 403 Forbidden or challenge page HTML instead of real content.
Routing my requests through a proxy like Bright Data's Web Unlocker fixed the 403s immediately, obviously, but this made me wonder... how were Cloudflare, DataDome, and PerimeterX actually detecting my programmatic access? What kind of logic does it take to identify something like that? And what does a proxy even change at the protocol level to bypass it?
To get into the guts of this — and find out how far I could get in Node.js without using anything at all — I tested five HTTP client setups against a live packet-inspection endpoint on 10 URLs I knew were protected.
What Do Anti-Bot Firewalls Actually Check For?
When you programmatically make an HTTP request, the server inspects how your client actually negotiates the connection first. Naturally, because Node.js uses server-oriented networking defaults and not browser ones (duh) its opening packets look nothing like Chrome's. It's a dead giveaway -- this is why programmatic requests get blocked.
Think of an HTTPS request as a three-step conversation. Your fancy spoofed User-Agent header actually doesn't even matter until Step 3:
Node.js Client WAF / Edge Server
│ │
├── 1. TLS ClientHello (Plaintext) ────────────────────►│ ◄── Scored via JA3 / JA4
│ Ciphers, extensions, curves, ALPN, GREASE │
│ │
├── 2. HTTP/2 Connection Preface & Frames ─────────────►│ ◄── Scored via Akamai H2
│ SETTINGS, WINDOW_UPDATE, pseudo-header order │
│ │
├── 3. HTTP Request Headers ───────────────────────────►│ ◄── Checked for consistency
│ User-Agent, sec-ch-ua, Accept-Encoding, Cookie │ against Steps 1 & 2
If the first or the second check identifies you as a command-line OpenSSL runtime, while the last one claims "This user is totally, definitely running Chrome 131 on Windows, trust!" -- none of your acrobatics will matter, the firewall will still deny the request on the spot.
Specifically, modern WAFs (Web Application Firewalls) check for these two fingerprints:
- The TLS Handshake (JA3 and JA4): An actual Chrome instance would use Google's BoringSSL, which injects randomized GREASE values (RFC 8701) into cipher and extension lists and enables brotli certificate compression. Node.js, on the other hand, compiles against standard OpenSSL, which offers dozens of legacy server ciphers, but no GREASE values or certificate compression.
- The HTTP/2 Framing (RFC 9113 Akamai Fingerprint): Right after TLS negotiation, HTTP/2 clients send a
SETTINGSframe, a flow-controlWINDOW_UPDATE, and four pseudo-headers (:method,:authority,:scheme,:path). Programmatic requests won't have this. (Not in its entirety, anyway.)
I could do nothing without knowing what these JA3/4 or HTTP/2 strings even looked like, so I hit up the tls.peet.ws inspection API to record the exact JA4 and HTTP/2 strings that are going to be applied against a given programmatic request I made.
I used five ways to make these programmatic requests, and this is what I got back:
| Node.js Client Stack | Protocol | ALPN Offered | Ciphers / Exts | GREASE / Cert Compress | JA4 Fingerprint | Akamai HTTP/2 Fingerprint |
|---|---|---|---|---|---|---|
1. Native fetch() (undici default) | HTTP/1.1 | http/1.1 | 52 / 12 | No / No | t13d5212h1_b262b3658495_8e6e362c5eac | None (HTTP/1.1 only) |
2. Customized undici.Agent (Using allowH2 + Ciphers) | h2 | http/1.1, h2 | 15 / 12 | No / No | t13d1512h1_8daaf6152771_8e6e362c5eac | |00|0|a,m,p,s |
3a. got-scraping (Pure-JS H2) | h2 | h2 | 15 / 13 | No / No | t13d1513h2_8daaf6152771_ff9cead5a15b | 2:0;4:33554432|4128769|0|m,p,a,s |
3b. impit (Rust Chrome 131) | h2 | h2, http/1.1 | 16 / 16 | Yes / Yes | t13d1516h2_8daaf6152771_02713d6af862 | 1:65536;2:0;4:6291456;5:16384;6:262144|15663105|0|m,a,s,p |
4. Playwright Headless Chromium | h2 | h2, http/1.1 | 16 / 19 | Yes / Yes | t13d1517h2_8daaf6152771_cb7bf5808d99 | 1:65536;2:0;4:6291456;6:262144|15663105|0|m,a,s,p |
5. fetch() + Bright Data Web Unlocker | h2 | h2, http/1.1 | 16 / 19 | Yes / Yes | t13d1517h2_8daaf6152771_cb7bf5808d99 | 1:65536;2:0;4:6291456;6:262144|15663105|0|m,a,s,p |
That first row explains the cause of those instant 403 blocks right away. Whenever you use fetch (undici) or axios, Node.js defaults to HTTP/1.1 only. This is a telltale sign that your request is a bot (technically speaking) -- because no modern desktop Chrome build would EVER connect over HTTP/1.1 with 52 ciphers when HTTP/2 is available.
But there's more to it than just that. Let's get into it.
Testing Five Node.js Stacks Against 10 WAF-Protected Sites
Let's test all five ways of making HTTPS requests against 10 live URLs that I know for sure are protected by Cloudflare, PerimeterX (HUMAN Security), DataDome, or AWS WAF.
A simple 200 OK won't do. I will only consider whether actual page content was returned — meaning we will disregard misleading responses like HTTP 202 Accepted on Booking.com (which passes a naive res.ok check, but only returns a ~4 KB AWS WAF challenge page instead of the actual page):
| Target Page | Active Protection | 1. Native fetch() | 2. Tuned undici.Agent | 3a. got-scraping | 3b. impit (Rust) | 4. Local Playwright | 5. fetch() + Web Unlocker |
|---|---|---|---|---|---|---|---|
| Canva Templates | Cloudflare Bot Mgmt | 403 | 200 OK | 200 OK | 200 OK | 200 OK | 200 OK |
| Discogs Album | Cloudflare Challenge | 403 | 200 OK | 200 OK | 403 | 200 OK | 200 OK |
| Zillow Search | PerimeterX (HUMAN) | 403 | 403 | 200 OK | 200 OK | 403 | 200 OK |
| Zillow Property | PerimeterX (HUMAN) | 403 | 403 | 200 OK | 200 OK | 403 | 200 OK |
| Wayfair Sofas | PerimeterX (HUMAN) | 429 | 429 | 429 | 200 OK | 429 | 200 OK |
| Crunchbase Org | Cloudflare Bot Mgmt | 403 | 403 | 403 | 200 OK | 200 OK | 200 OK |
| TripAdvisor Index | DataDome Anti-Bot | 403 | 403 | 403 | 403 | 403 | 200 OK |
| TripAdvisor Review | DataDome Anti-Bot | 403 | 403 | 403 | 403 | 403 | 200 OK |
| Yelp Business | DataDome Anti-Bot | 403 | 403 | 403 | 403 | 403 | 200 OK |
| Booking.com Hotel | AWS WAF Bot Control | 202 | 202 | 202 | 202 | 202 | 200 OK |
| Pass Rate | — | 0 / 10 (0%) | 2 / 10 (20%) | 4 / 10 (40%) | 5 / 10 (50%) | 3 / 10 (30%) | 10 / 10 (100%) |
This is great -- now we know exactly what each layer fixes, and what makes it fail. Let's walk through them real quick.
Why Manual undici.Agent Tuning Isn't Enough
Enabling HTTP/2 and passing Chrome's cipher list in undici gets you past lightweight Cloudflare checks, but fails on literally everything else. This is because Node's built-in HTTP/2 binding is still leaking its real identity through protocol ordering.
To give native Node.js its best shot without third-party binaries, I configured a custom UndiciAgent with allowH2: true and Chrome 131's exact 15 cipher suites. These can be obtained at the BrowserLeaks TLS Client Test page:
allowH2is an undici Agent setting. If you set it totrue, NodeJS offers HTTP/2 if the server supports it. Otherwisefetch()will only ever use HTTP/1.1. Learn more here: https://undici.nodejs.org/api/Client
import { Agent as UndiciAgent, fetch as undiciFetch } from "undici";
// OpenSSL names: https://docs.openssl.org/master/man1/openssl-ciphers/#cipher-suite-names
const CHROME_CIPHERS = [
"TLS_AES_128_GCM_SHA256",
"TLS_AES_256_GCM_SHA384",
"TLS_CHACHA20_POLY1305_SHA256",
"ECDHE-ECDSA-AES128-GCM-SHA256",
"ECDHE-RSA-AES128-GCM-SHA256",
"ECDHE-ECDSA-AES256-GCM-SHA384",
"ECDHE-RSA-AES256-GCM-SHA384",
"ECDHE-ECDSA-CHACHA20-POLY1305",
"ECDHE-RSA-CHACHA20-POLY1305",
"ECDHE-RSA-AES128-SHA",
"ECDHE-RSA-AES256-SHA",
"AES128-GCM-SHA256",
"AES256-GCM-SHA384",
"AES128-SHA",
"AES256-SHA",
].join(":");
const tunedAgent = new UndiciAgent({
allowH2: true,
connect: {
ciphers: CHROME_CIPHERS,
minVersion: "TLSv1.2",
maxVersion: "TLSv1.3",
ALPNProtocols: ["h2", "http/1.1"],
},
});
const res = await undiciFetch("https://www.canva.com/templates/", {
dispatcher: tunedAgent,
headers: CHROME_HEADERS,
});
Shrinking the cipher list from 52 down to Chrome's 15 wil match Chrome's JA4 cipher hash exactly (more accurately, it should match it, but...read on.) As expected, this was enough to pass Canva and Discogs.
That's only 2 out of 10, but still, progress! Now we're getting somewhere.
So why did this not work for the other eight targets?
- Our config for
undicistill lets it slip to the firewall that it prefers HTTP/1.1 -- whoops. - Our HTTP/2 setup is actually not in the right order. Once a HTTP/2 connection is live, Chrome (the browser) will actually send its built-in request fields in a specific order (HTTP method first, domain name second, and so on). Node requests on the other hand send a completely blank settings packet, and put the domain name first — a dead giveaway.
Good news is, we can fix these easily.
How to scale beyond undici with Rust
To fix Node's HTTP/2 frames and missing TLS extensions locally, you have to step outside undici. Pure JavaScript libraries get halfway there, while native Rust addons match Chrome closely enough to unlock half of our test suite.
Historically, spoofing BoringSSL in Node.js meant wrapping something like C++ curl-impersonate child processes or brittle native bindings.
Thankfully, we have easier options today:
- got-scraping (Worked on 4/10 sites): A pure JavaScript library that fixes both
undiciquirks — it asks for HTTP/2 first and sends realistic connection settings, which was enough to access both Zillow pages. Huge caveat -- because it still relies on Node's built-in TLS engine underneath, it can't fake Chrome-only encryption features or exact field ordering, so Wayfair and Crunchbase still blocked it. - impit (Worked on 5/10 sites): Sidesteps Node's built-in networking completely, using a prebuilt Rust engine behind a drop-in
fetch()API:
Here's how you use impit in NodeJS:
import { Impit } from "impit";
const client = new Impit({
browser: "chrome131",
timeout: 15_000,
});
const res = await client.fetch("https://www.wayfair.com/furniture/sb0/sofas-c413892.html");
console.log(res.status); // 200 OK (3.4 MB HTML)
Because impit builds the connection in Rust instead of Node.js, it correctly reproduces Chrome's TLS extensions, buffer sizes, and HTTP/2 field order out of the box. This makes sites like Wayfair and Crunchbase work — proving Cloudflare on Crunchbase was actually rejecting Node's handshake rather than my IP!
Still, impit hit a hard ceiling and we only got 5 out of 10 sites working. Turns out, even when your connection looks like Chrome, an HTTP client cannot fix IP reputation or solve interactive JavaScript challenges. DataDome on TripAdvisor and Yelp still blocked impit on every request, and AWS WAF on Booking.com kept returning its 202 challenge page.
So impit alone is not enough. What fixes it?
Why Local Headless Chromium Can't Bypass WAF Either
Annoyingly, local Playwright Headless Chromium didn't help either -- it only passed 3 out of 10 targets, failing on both Zillow pages and Wayfair where impit sailed right through with 200 OK.
This is as surprising as it is annoying. Why would a real browser lose to a Rust HTTP client, especially on the exact same machine and IP?
With Playwright, Chromium will actually execute PerimeterX's embedded JavaScript sensor suite. This immediately shows telltale signs of headless browser automation (Puppeteer/Playwright can't hide its navigator.webdriver and DevTools runtime traits) and triggers a 403 or 429 block.
But there's some good news -- we can fix this, too.
The Real Solution: Bright Data's Web Unlocker Gets Past Cloudflare/Datadome/PerimeterX
A normal proxy only changes your IP address. But an unblocking proxy terminates your Node.js connection at the edge and opens a brand-new browser connection upstream, replacing your fingerprint entirely -- thus solving challenges automatically.
But this raises the obvious question: if HTTPS is encrypted, how did putting a proxy in front of plain fetch() hide Node's TLS and HTTP/2 signature?
It actually comes down to the difference between TCP tunneling and edge TLS termination:
-
Standard HTTP/SOCKS proxies (
CONNECTtunnel): YourProxyAgentasks the proxy to open a raw TCP connection to port 443 on the target server, then your local Node.js process performs the TLS handshake end-to-end through it. Your IP changes, but Cloudflare and DataDome still see your exact local OpenSSLClientHelloand HTTP/1.1 framing — so plainfetch()is still a no-go. -
Unblocking proxies (edge TLS termination): Bright Data's Web Unlocker actually terminates your Node.js TLS session at the proxy edge (which is why
ProxyAgentsetsrequestTls: { rejectUnauthorized: false }below) and opens a fresh upstream connection to the target website using a real browser networking stack.
We can actually prove this. I tried to access tls.peet.ws programmatically with the same plain-old undici fetch(), just using it through the Web Unlocker proxy instead, and that actually recorded an upstream fingerprint of t13d1517h2_8daaf6152771_cb7bf5808d99 and 1:65536;2:0;4:6291456;6:262144|15663105|0|m,a,s,p -- identical to real Chrome.
Web Unlocker's edge solver cleared DataDome interstitials on even TripAdvisor and Yelp, and solved AWS WAF's 202 token challenge on Booking.com too, to hit a full 10 out of 10 (100%).
Drop-In Setup
Here's how it works:
import { ProxyAgent, fetch as undiciFetch } from "undici";
// Format: brd-customer-<ID>-zone-<UNLOCKER_ZONE>:<PASSWORD>
const auth = process.env.BRIGHT_DATA_UNLOCKER_AUTH!;
const host = process.env.BRIGHT_DATA_UNLOCKER_PROXY_HOST ?? "brd.superproxy.io";
const port = process.env.BRIGHT_DATA_UNLOCKER_PROXY_PORT ?? "33335";
const unlockerProxy = new ProxyAgent({
uri: `http://${auth}@${host}:${port}`,
requestTls: { rejectUnauthorized: false },
proxyTls: { rejectUnauthorized: false },
});
export async function fetchProtectedPage(url: string): Promise<string> {
const res = await undiciFetch(url, {
dispatcher: unlockerProxy,
headers: {
"User-Agent":
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36",
Accept: "text/html,application/xhtml+xml",
"Accept-Language": "en-US,en;q=0.9",
},
redirect: "follow",
signal: AbortSignal.timeout(60_000),
});
if (!res.ok) {
throw new Error(`HTTP ${res.status} on ${url}`);
}
return await res.text();
}
There's a little footgun to watch out for, though.
Why you should not send a full CHROME_HEADERS bundle if you're using Bright Data
Web Unlocker dynamically picks a browser fingerprint, OS profile, and residential IP at the edge (and retries with a different browser profile if challenged). If your Node.js script hardcodes sec-ch-ua-platform: "Windows" or Accept-Encoding: zstd, those pinned headers can conflict with the TLS profile Web Unlocker negotiates upstream.
When to Combine impit with Residential Proxies Instead
Web Unlocker takes a few extra seconds when solving tough DataDome or AWS WAF challenges (averaging ~4 seconds on sites like Canva and Zillow, and 19–36 seconds when solving multi-step challenges on Booking.com or Yelp).
If you're running anything latency-sensitive, say, an AI agent that is fetching sites that already pass wire checks locally with impit (like Crunchbase, Zillow, or Wayfair) using a proxy will only block your server's datacenter IP because of rate limits. So a standard CONNECT tunnel actually works much better in that case.
Putting these together, your impit library will supply the authentic Chrome TLS/HTTP2 handshake end-to-end while Bright Data Residential Proxies supply residential IPs for sub-second (<1ms) responses:
import { Impit } from "impit";
const fastClient = new Impit({
browser: "chrome131",
proxyUrl: `http://brd-customer-${process.env.BD_CUSTOMER}-zone-${process.env.BD_RESIDENTIAL_ZONE}:${process.env.BD_PASS}@brd.superproxy.io:33335`,
timeout: 15_000,
});
And for the subset of websites where the server returns an empty React <div id="app"></div> shell that genuinely needs browser execution after unblocking, you can still connect Playwright remotely to Bright Data Scraping Browser instead of babysitting local Chromium processes. It's a win-win.
Which Node.js HTTP Client Should You Use?
For most backend data pipelines, just pick the lightest HTTP stack that bypasses your target's specific firewall layer rather than defaulting to a headless browser.
Match your client choice to the protection you're trying to get past:
| Protection Level on Target | Recommended Node.js Stack | Benchmark Pass Rate | Memory Footprint | Why It Fits |
|---|---|---|---|---|
| Unprotected APIs & Static HTML | Native fetch() (undici) or axios | 0 / 10 on WAFs | ~45 MB | Built-in, fast, zero dependencies |
| Basic Cloudflare ALPN Checks | Custom undici.Agent (allowH2 + Ciphers) | 2 / 10 | ~45 MB | Fixes cipher hash without native addons |
| TLS + HTTP/2 Checks (No JS Challenge) | impit + Residential Proxies | 5 / 10 (local IP) | ~55 MB | Sub-second Rust BoringSSL spoofing + clean IP rotation |
| DataDome, Turnstile & AWS WAF (SSR HTML) | Native fetch() + Web Unlocker | 10 / 10 | ~45 MB | Edge Chrome JA4/H2 + automatic challenge solving |
| WAF-Protected Client-Rendered SPAs | Playwright + Scraping Browser | — | ~85 MB | Full remote DOM rendering + built-in unblocking |
That's everything, thanks for reading!
Frequently Asked Questions
Why does Node.js fetch() get 403 Forbidden even with Chrome browser headers?
Anti-bot firewalls inspect the plaintext TLS ClientHello (JA3/JA4) and HTTP/2 connection frames before reading HTTP headers. Native Node.js fetch() negotiates HTTP/1.1 only and sends 52 OpenSSL cipher suites without TLS GREASE (t13d5212h1_b262b3658495_8e6e362c5eac), which immediately contradicts a Chrome User-Agent header.
Can https.Agent or undici.Agent spoof a Chrome JA4 and HTTP/2 fingerprint in pure Node.js?
No. Passing allowH2: true and Chrome's cipher list to undici.Agent matches Chrome's cipher hash (8daaf6152771), which unlocks basic Cloudflare checks, but undici still offers http/1.1 before h2 in ALPN, lacks OpenSSL APIs for TLS GREASE or compress_certificate, and sends an empty HTTP/2 SETTINGS frame with :authority first (|00|0|a,m,p,s).
Should I use got-scraping or impit to bypass TLS fingerprinting in Node.js?
Prefer impit when prebuilt NAPI-RS binaries support your platform. got-scraping still relies on Node's OpenSSL and node:http2 modules (40% pass rate in our test), whereas impit uses a patched Rust TLS and HTTP/2 stack that emits TLS GREASE, certificate compression, and Chrome's m,a,s,p pseudo-header order (50% pass rate locally).
How do I bypass DataDome or Cloudflare 403 blocks in Node.js without running Puppeteer or Playwright?
A standard pass-through proxy is not enough for plain fetch() because an HTTP CONNECT tunnel still exposes Node's local OpenSSL handshake to the target server. Instead, route fetch() through an HTTPS-terminating unblocking proxy like Bright Data Web Unlocker using undici's ProxyAgent — it terminates Node's connection at the edge and opens a fresh upstream request with an authentic Chrome JA4/HTTP2 fingerprint, residential IP rotation, and automatic WAF challenge solving.
Further Reading
Discover more articles on similar topics across our network
Comments
Loading comments…