proxying-agent is a Node.js library providing an HTTP/HTTPS forward proxy agent. It is built upon Node's native `http.Agent` and offers features for transparently routing HTTP and HTTPS requests through a specified proxy server. Key capabilities include support for SSL tunneling via the HTTP CONNECT method, Basic authentication, and a beta implementation of NTLM authentication, allowing for domain-specific username formats (e.g., `domain\username`). The library also provides a `globalize` method to easily configure all subsequent `http` and `https` requests to use a designated proxy. The current stable version is 2.4.0, released in July 2017. Due to its age, it is considered abandoned, with no active development or maintenance since its last update. This lack of recent activity suggests potential incompatibilities with newer Node.js versions and a risk of unaddressed security vulnerabilities, making it crucial for users to assess its suitability for modern applications.
npm install proxying-agentVerified import paths — ran on the pinned version, not inferred.
This example demonstrates how to create and use `proxying-agent` with NTLM authentication for an HTTPS request, including the crucial `req.on('socket')` pattern for NTLM.
Consider migrating to a actively maintained proxy agent library (e.g., `https-proxy-agent`, `socks-proxy-agent`) or implementing custom proxy logic using newer Node.js APIs.
Attach an event listener for the 'socket' event to your `http.ClientRequest` object and perform `req.write()` or `req.end()` within that listener: `req.on('socket', (socket) => { req.end(); });`Ensure `require('proxying-agent').globalize(options);` is one of the very first lines of your application's entry point, or at least before any HTTP/HTTPS requests are created.Thoroughly test NTLM functionality in your environment and consider the security implications of using an unmaintained beta feature. If NTLM is critical, seek alternatives or custom implementations.
Use CommonJS `require` syntax: `const proxyingAgent = require('proxying-agent');` or `const { create } = require('proxying-agent');`.Double-check the username and password in the proxy URL (`http://username:password@proxy.example.com`). Ensure the `authType` option (`basic` or `ntlm`) matches the proxy server's requirements. For NTLM, verify `domain` and `workstation` settings.
Inspect the certificates involved. You might need to provide custom `tlsOptions` (e.g., `ca`, `cert`, `key`) to the `create` method, or temporarily set `rejectUnauthorized: false` for testing (NOT recommended for production). Ensure your system's root CAs are up to date.
This package is abandoned and unlikely to be compatible with modern Node.js versions. Migrate to an actively maintained proxy agent library that supports current Node.js APIs.
No dependency data recorded yet.