caw is a JavaScript utility designed to simplify the creation of HTTP/HTTPS agents for tunneling through proxies. It abstracts the configuration of proxy agents by internally utilizing `tunnel-agent` for the tunneling logic and `get-proxy` for automatic discovery of proxy settings from environment variables if a proxy URL is not explicitly provided. The current stable version is 2.0.1. Due to the age of its underlying dependencies (`tunnel-agent` and `get-proxy`), which are themselves largely unmaintained or deprecated, `caw` has seen no recent development and can be considered abandoned. It serves a niche for older Node.js environments (targeting `node >=4`) that require simple proxy agent construction, but modern applications should seek more actively maintained alternatives.
npm install cawVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to create and use `caw` agents with the `got` HTTP client, both with explicit proxy URLs and automatic proxy discovery from environment variables.
Consider migrating to actively maintained libraries such as `http-proxy-agent`, `https-proxy-agent`, or `socks-proxy-agent` for proxy tunneling, ideally used with modern HTTP clients like `undici` or `axios` with appropriate proxy agent integration.
Always use `const caw = require('caw');` for importing. For ESM-only projects, a direct migration to an ESM-first proxy agent library is the most robust solution.Thoroughly test `caw` on your target Node.js version. For production environments, it is highly recommended to migrate to a current, actively maintained solution that explicitly supports your Node.js runtime.
Always provide an explicit `proxy` URL to `caw(proxyUrl)` for predictable behavior. If relying on environment variables, ensure they are correctly configured and understood for the application's context. Always be mindful of `NO_PROXY` to prevent local requests from being proxied.
Change the import statement to `const caw = require('caw');` or convert your project to CommonJS. For pure ESM projects, migrate to an ESM-compatible proxy agent library.Verify the proxy URL, port, and authentication credentials. Ensure network connectivity from your application to the proxy server. Check the proxy server's logs for more detailed error information. Also, check for `NO_PROXY` environment variables that might unintentionally prevent proxying for certain domains.
Upgrade to a modern, actively maintained HTTP/HTTPS proxy agent library (e.g., `@http-proxy-agent/https`, `@https-proxy-agent/https`) that is explicitly compatible with your Node.js version and chosen HTTP client.