Registry / security / axios-ddos-guard-bypass

axios-ddos-guard-bypass

JSON →
library1.0.3jsnpmunverified

Node.js library (v1.0.3) that wraps Axios to automatically detect and bypass DDoS Guard protection (https://ddos-guard.net/en). Acts as an Axios interceptor: when a request encounters a DDoS Guard challenge page, it solves it by executing the challenge (typically JavaScript), extracts the resulting cookies, and retries the original request. Supports optional tough-cookie CookieJar for persistent session management and HTTP/HTTPS proxies. Fully typed with TypeScript, requires Node >=14. Unlike manual cookie handling or headless browser approaches, this is lightweight and API-friendly.

npm install axios-ddos-guard-bypass
INSTALL
IMPORT
SIG · AXIOS-DDOS-GUARD-B
A
axios-ddos-guard-bypass
securityjavascriptv1.0.3
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ddosGuardBypass
import { ddosGuardBypass } from 'axios-ddos-guard-bypass'
const { ddosGuardBypass } = require('axios-ddos-guard-bypass')
ESM-only package — CommonJS require() will fail unless using a dynamic import or transpilation
module (default import)
import * as DdosGuard from 'axios-ddos-guard-bypass'; DdosGuard.ddosGuardBypass(agent)
import DdosGuard from 'axios-ddos-guard-bypass'
No default export — only named exports exist
type-only (TypeScript)
import type { DdosGuardBypassConfig } from 'axios-ddos-guard-bypass'
import { DdosGuardBypassConfig } from 'axios-ddos-guard-bypass' at runtime
DdosGuardBypassConfig is a TypeScript type/interface, not a runtime value

Creates an Axios instance, attaches DDoS Guard bypass interceptor, and makes a GET request with automatic challenge solving.

import axios from 'axios'; import { ddosGuardBypass } from 'axios-ddos-guard-bypass'; import { CookieJar } from 'tough-cookie'; const agent = axios.create(); const cookieJar = new CookieJar(); agent.defaults.jar = cookieJar; ddosGuardBypass(agent); async function main() { const response = await agent.get('https://example.com', { headers: { Referer: 'https://example.com' } }); console.log(response.data); } main().catch(console.error);
Debug
Known issues
gotchaStreaming request bodies (FormData, ReadableStream) cannot be retried because the stream is already consumed — throws an error.
fix
Pass a Buffer instead of a stream, e.g., use form.getBuffer() for FormData.
affects: >=1.0.0
gotchaThe package does not export a default export — attempting `import DdosGuard from 'axios-ddos-guard-bypass'` yields undefined.
fix
Use named import: `import { ddosGuardBypass } from 'axios-ddos-guard-bypass'`.
affects: >=1.0.0
gotchaCookieJar must be attached to the Axios instance via `agent.defaults.jar` or passed in `response.config.jar` — otherwise cookies may not be persisted between requests.
fix
Create a tough-cookie CookieJar and assign it to `agent.defaults.jar` before calling ddosGuardBypass.
affects: >=1.0.0
gotchaThe bypass mechanism relies on executing JavaScript from the challenge page — if the challenge changes format, the package may fail to bypass.
fix
Monitor the GitHub repo for updates; the maintainer may need to release a new version to handle new challenge patterns.
affects: >=1.0.0
gotchaNode version must be >=14 — older versions do not have the required features (e.g., global fetch, URL APIs used internally).
fix
Upgrade Node to v14 or later.
affects: >=1.0.0
Errors
Common errors & fixes
ERR_REQUIRE_ESM: require() of ES Module /path/to/axios-ddos-guard-bypass/index.mjs not supported.
Using CommonJS require() on an ESM-only package.
fix
Switch to dynamic import: `const { ddosGuardBypass } = await import('axios-ddos-guard-bypass');` or use a bundler that supports ESM.
TypeError: cookieJar.getCookiesSync is not a function
Attempting to use tough-cookie v4+ method on an older CookieJar or not attaching the jar correctly.
fix
Ensure you pass a valid tough-cookie CookieJar instance (import { CookieJar } from 'tough-cookie') and assign it to agent.defaults.jar.
Error: Retrying request with stream body is not supported.
Passing a stream (e.g., FormData, ReadableStream) as request body which can't be replayed.
fix
Convert stream to Buffer (e.g., form.getBuffer() for FormData) before sending.
ReferenceError: document is not defined
The package internally uses a DOM-like environment to execute challenge JS, but this error indicates a missing polyfill for non-Node environments.
fix
Run only in Node.js >=14; do not use in browser or serverless environments without the required globals.
Upgrade
Version history
1.0.3latest on npm
Audit
Dependencies
axiosrequiredpeer dependency — wraps Axios instance to intercept requests
tough-cookieoptionaloptional peer dependency — used for cookie jar persistence only when provided
Agent activity
29 hits · last 30 days
node
26
Amazon
1
OpenAI (training)
1
Resources
axios-ddos-guard-bypass — npm install axios-ddos-guard-bypass · libregistry