The `http-echo-server` package provides a minimalist HTTP server designed primarily for debugging and testing network requests. It accepts any TCP connection and immediately echoes back the entire incoming TCP content as an HTTP response. Crucially, it does not parse or understand the HTTP protocol, meaning it will respond with the raw bytes received, including headers and body, without interpretation. The server will terminate the TCP connection exactly 2 seconds after the first data packet is received, regardless of whether the full request has arrived. This behavior makes it unsuitable for production environments or as a general-purpose HTTP server but highly effective for inspecting raw network traffic. The current stable version is 2.1.1. Given its utility nature, the release cadence is likely infrequent, driven by bug fixes or minor enhancements. Its key differentiator is its deliberate simplicity and lack of HTTP protocol understanding, making it a 'transparent pipe' for raw request inspection.
npm install http-echo-serverVerified import paths — ran on the pinned version, not inferred.
Demonstrates starting the HTTP echo server via the command line using `npx` and testing it with `curl`, showing the raw request echoing. It also includes an example of programmatic server creation.
Understand that the server replies with the raw incoming TCP stream content, not a parsed HTTP response. Do not expect standard HTTP parsing, routing, or header interpretation beyond simple echoing.
Be aware of the fixed 2-second connection timeout after initial data. Ensure your requests complete within this window or adjust expectations for partial responses, as longer requests will be cut off.
Account for additional Heroku-specific headers (e.g., `X-Forwarded-For`, `X-Forwarded-Proto`, `X-Request-ID`) in the echoed response when debugging Heroku deployments. The echoed content will include these additions.
Choose a different port (e.g., `http-echo-server 3005`), identify and terminate the conflicting process using tools like `lsof -i :<port>` (macOS/Linux) or `netstat -ano | findstr :<port>` (Windows), or ensure no other instance of the echo server is running.
Run the command using `npx http-echo-server` (if the package is installed locally in your project), or ensure the package is installed globally with `npm install -g http-echo-server` and your global npm bin directory is in your system's PATH.
No dependency data recorded yet.