Catalog npm
PACKAGE EXPLORERView in registry

11dice

npm

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.

fetchfree-proxyload-testproxiesproxyproxy-poolrate-limitrotaterotationscrapingundici
Versions collected2
Direct dependencies5From release 0.2.0
Last observed20 Oct, 18:05 UTC

README

Current package documentation

11dice

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

Features

  • Auto-scraping — pulls free proxies from trusted CDN sources (jsDelivr/API endpoints) on startup and refreshes them every 15 minutes by default. Add your own sources or seed a list directly via proxyList.
  • Auto-validation — every scraped proxy is probed for liveness before it enters the pool, so you rarely ask a dead proxy to do work.
  • Rotation — random (default), round-robin, or sticky (reuse one proxy for N requests to keep sessions).
  • Retries — transparently retries 429 / 5xx and network failures through a different proxy.
  • Realistic User-Agent — a random real browser UA is attached by default; your own explicit user-agent header always wins.
  • HTTP, HTTPS & SOCKS5 — powered by undici's ProxyAgent.
  • TypeScript — full type definitions, ESM + CJS.

Install

npm install 11dice

Requires Node.js >=20.18.0.

Quick start

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

Options

All fields are optional; defaults are safe for most users.

OptionDefaultDescription
protocols['http', 'https', 'socks5']Proxy protocols to keep in the pool.
sourcesbuilt-in listCustom url (and optional protocol hint) sources. [] disables scraping.
proxyList[]Seed proxies directly: 'host:port', 'scheme://host:port', or full ProxyInfo objects.
maxProxies200Cap on pooled proxies.
minProxies10Minimum alive proxies before the pool is "ready" for a request.
validationTargethttps://example.comURL used to probe liveness.
validationTimeoutMs8000Per-probe timeout.
validationConcurrency50Probes run in parallel.
validateOnRefreshtrueProbe sources after scraping.
requestTimeoutMs15000Per-attempt timeout.
refreshIntervalMs900000 (15 min)Re-scrape cadence.
autoRefreshtrueScrape on startup and on the interval.
retries3Extra 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'.
stickyRequests5Requests per proxy in 'sticky' mode.
userAgentstruetrue = built-in UA pool, string[] = your UAs, false = never send the header.
maxConcurrentInfinityCap on concurrent requests.
fallbackDirectfalseSend directly (no proxy) when the pool is empty.
strictProxiestrueThrow NoProxiesAvailableError instead of going direct when the pool stays empty.
logfalseLog refresh/validation activity to stderr.

Per-request options

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.

The returned response

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.

Errors

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.

Disclaimer

Use at your own risk, and only against servers you control or have explicit permission to load-test.

  • Free proxies are unreliable, slow, and commonly operated by strangers. They can read, log, drop, or tamper with every byte you send through them. Never route credentials, tokens, or any sensitive or personally identifiable data through this client.
  • A proxy can MITM your traffic, return forged responses, or black-hole requests. Treat all proxied responses as untrusted input.
  • Do not use this to hammer websites, APIs, or services you do not own or that do not authorize load testing — that is abuse and may be illegal.
  • Free proxy lists churn constantly; expect intermittent failures and flaky results. This package is a convenience wrapper over data you did not author.

By using 11dice you accept full responsibility for the traffic you send and the targets you send it to.

License

MIT

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 2

Collected releases
VersionPublishedDirect dependenciesOpen version
0.2.0Registry latest7 Sept 20265
0.1.07 Sept 20265

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 18:05 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:c37b9047f1ed89f70e490167d769f98493a4c120b6cf10d6c1609d6e42e4f299