proxy-test-server is a lightweight Node.js module designed to create a simple HTTP proxy server, primarily for testing proxied connections. It specifically handles HTTP `CONNECT` requests, enabling clients to establish a tunnel through the proxy to a destination server, such as for HTTPS traffic. It does not provide full HTTP proxying (e.g., modifying HTTP headers directly) but focuses on the `CONNECT` method for transparent tunneling. The package is currently at version 1.0.0 and appears to be in a maintenance state, with no active development or a defined release cadence, indicating a stable but minimally evolving codebase. Its key differentiator is its straightforward, minimal implementation for verifying basic proxy connectivity, rather than offering advanced features like mocking, traffic inspection, or support for multiple proxy protocols (SOCKS, HTTPS) found in more comprehensive proxy tools like Mockttp or Check-Proxy.
npm install proxy-test-serverVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to initialize and start an HTTP CONNECT proxy server, listen for incoming connections, log proxy activity, and handle common errors like port conflicts. Includes instructions for testing with curl.
Ensure your client is configured to use the proxy for CONNECT requests (e.g., HTTPS requests) or use a different proxy library for full HTTP proxying.
Implement strict IP-based access control, authentication, or ensure the proxy is only accessible within a secure, controlled testing environment. Do not expose this server to the public internet.
For ESM projects, consider using a dynamic `import()` or ensuring your project configuration (e.g., `package.json` `type`) correctly handles interoperability between CommonJS and ESM. Alternatively, use a modern proxy library with explicit ESM support.
Verify that no local software or network devices are blocking the port the proxy is listening on, or the outgoing connections from the proxy. Temporarily disable firewalls or add explicit allow rules for the proxy process and port.
Choose a different port for your proxy server that is not currently in use, or stop the process that is occupying the desired port.
Use a port number greater than 1024, or run your Node.js application with elevated privileges (e.g., `sudo node your_script.js`), though the latter is generally not recommended for production.
Ensure the proxy server is running and listening on the correct IP address and port. Verify that there are no typos in the proxy address provided to the client. Check network connectivity between client and proxy.
Check the proxy server's console output for specific error messages (e.g., from `proxy.on('error')` or `socket.on('error')` listeners). This could indicate issues with the proxy's outbound network connectivity or an unhandled error in its internal logic.If in a CommonJS context, use `const HttpConnectProxy = require('proxy-test-server');`. If in an ESM context, you might need to adjust your `import` statement or Node.js configuration to properly handle CommonJS module interoperability, or consider dynamically importing it.No dependency data recorded yet.