Observed since 20 Oct, 18:05 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
fetch with automatic rotating free proxies. Scrapes public proxy lists, validates them, and routes every request through a random working proxy. Proper defaults, works out of the box.
A fetch-like HTTP client for Node.js that scrapes free proxies, validates them, and rotates through a fresh proxy on every request — so you can hammer your own servers or APIs without tripping IP-based rate limits.
import { ElevenDice } from '11dice'
const client = new ElevenDice({ rotation: 'random' })
const res = await client.fetch('https://api.example.com/health')
console.log(res.proxy.url) // the proxy that actually served the request
proxyList.random (default), round-robin, or sticky (reuse one proxy
for N requests to keep sessions).429 / 5xx and network failures through
a different proxy.user-agent header always wins.ProxyAgent.npm install 11dice
Requires Node.js >=20.18.0.
import { ElevenDice } from '11dice'
const client = new ElevenDice({
rotation: 'round-robin',
retries: 3, // extra proxies tried after the first failure
retryStatuses: [429, 500, 502, 503, 504],
})
const res = await client.fetch('https://httpbin.org/headers', {
headers: { 'x-anything': 'yes' },
})
console.log(res.status) // 200
console.log(res.proxy?.host) // the IP that served you
console.log(res.elapsedMs) // total time including retries
await client.close() // stop the refresh timer
All fields are optional; defaults are safe for most users.
| Option | Default | Description |
|---|---|---|
protocols | ['http', 'https', 'socks5'] | Proxy protocols to keep in the pool. |
sources | built-in list | Custom url (and optional protocol hint) sources. [] disables scraping. |
proxyList | [] | Seed proxies directly: 'host:port', 'scheme://host:port', or full ProxyInfo objects. |
maxProxies | 200 | Cap on pooled proxies. |
minProxies | 10 | Minimum alive proxies before the pool is "ready" for a request. |
validationTarget | https://example.com | URL used to probe liveness. |
validationTimeoutMs | 8000 | Per-probe timeout. |
validationConcurrency | 50 | Probes run in parallel. |
validateOnRefresh | true | Probe sources after scraping. |
requestTimeoutMs | 15000 | Per-attempt timeout. |
refreshIntervalMs | 900000 (15 min) | Re-scrape cadence. |
autoRefresh | true | Scrape on startup and on the interval. |
retries | 3 | Extra attempts through different proxies after a failure. |
retryStatuses | [429, 500, 502, 503, 504] | Status codes that trigger a retry. |
rotation | 'random' | 'random', 'round-robin', or 'sticky'. |
stickyRequests | 5 | Requests per proxy in 'sticky' mode. |
userAgents | true | true = built-in UA pool, string[] = your UAs, false = never send the header. |
maxConcurrent | Infinity | Cap on concurrent requests. |
fallbackDirect | false | Send directly (no proxy) when the pool is empty. |
strictProxies | true | Throw NoProxiesAvailableError instead of going direct when the pool stays empty. |
log | false | Log refresh/validation activity to stderr. |
fetch accepts everything undici's fetch does, plus:
timeoutMs — override requestTimeoutMs for this call.proxy — force one specific proxy for this call, skipping rotation.rotation — override the pool strategy for this call.client.fetch returns a standard Response (use .json(), .text(), etc.)
with these extras:
res.proxy — the ProxyInfo that served the request, or null for direct.res.attempts — every proxy tried, in order.res.elapsedMs — total wall-clock time including retries.import { NoProxiesAvailableError, AllRetriesFailedError } from '11dice'
NoProxiesAvailableError — the pool is empty after a refresh and no fallback
applies.AllRetriesFailedError — every attempt (through different proxies) failed;
.cause holds the final underlying error.InvalidProxyError, UnsupportedProtocolError — bad proxyList entries.Use at your own risk, and only against servers you control or have explicit permission to load-test.
By using 11dice you accept full responsibility for the traffic you send and
the targets you send it to.
MIT
Download counts and popularity will appear here as the collector receives them.
This describes our collected data; it is not a security assessment.
Observed since 20 Oct, 18:05 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:c37b9047f1ed89f70e490167d769f98493a4c120b6cf10d6c1609d6e42e4f299