HTTPCloak is a Node.js HTTP client specifically engineered for advanced browser fingerprint emulation across HTTP/1.1, HTTP/2, and HTTP/3 (QUIC) protocols. It is designed to mimic real browser characteristics, including TLS and HTTP/2 fingerprints, to bypass sophisticated bot detection systems. The current stable version is 1.6.1, indicating an actively developed library that regularly incorporates updates necessary to counter evolving anti-bot technologies. While a formal release cadence isn't specified, libraries in this domain typically require frequent maintenance. Its key differentiators include comprehensive multi-protocol support and configurable browser presets, making it highly effective for web scraping, automation, and bypassing anti-bot measures.
npm install httpcloakVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates promise-based asynchronous usage of HTTPCloak, covering GET and POST requests, handling responses, and executing concurrent requests, while emphasizing proper session management with `session.close()`.
Always ensure `session.close()` is called in a `finally` block or equivalent cleanup mechanism after all requests associated with the session are completed. For streaming, `stream.close()` is also necessary.
Ensure you are running a recent Node.js version (e.g., Node.js 18+ for best HTTP/3 stability). If encountering issues, test with HTTP/2 or HTTP/1.1 by explicitly setting `protocol: 'http2'` or `protocol: 'http1'` in session options, or by disabling HTTP/3 in presets if possible.
Use `const { Session } = require('httpcloak');` for CommonJS and `import { Session } from 'httpcloak';` for ES Modules to correctly import the Session class.Change your import statement to `import { Session } from 'httpcloak';` and ensure your project is configured for ESM (e.g., `"type": "module"` in `package.json`).Verify that `import { Session } from 'httpcloak';` (ESM) or `const { Session } = require('httpcloak');` (CJS) is used, and that you are creating an instance: `const session = new Session({...});`.Ensure that `session.close()` is called only once, after all operations for that session are complete. If concurrent operations are intended, manage them with `Promise.all` before closing the session, or use separate sessions for distinct sets of operations.
No dependency data recorded yet.