Sets up a proxy to forward requests with a specified delay on them.

Slow Proxy (for Node.js)

The Slow Proxy module is used to stream an existing URL and adjust response time. It allows you to simulate server delays without creating redundant pages.

Install the module:

npm install slow-proxy


Add to your package.json file:

  "name":        "my-app",
  // ...
  "dependencies": {
    // ...
    "slow-proxy": "0.1.0"

Require the module:

var proxy = require("slow-proxy");

Set the hostname for the domain you would like to proxy:

proxy.set("hostname", "");

This is the simplest way to leverage the module. It will setup an Express route on /proxy/ (by default). The route technique requires the delay to be part of the path; the delay is specified as the last "folder" before the proxied path. For example: will return with a 3 second delay applied.


The second (optional) parameter of the route method can be designated to override the base path. For example - to have your proxy work via the root path (

proxy.route(app, "/");

Similar to the route example, but explicitly defined. The first parameter being the original url to fetch, the second param being the delay value (in milliseconds), and the third value being the callback function to run when the fetch completes.

app.get(/\/proxy\/(\d+)\/(.*)$/, function(request, response) {
  // Call the `fetch` method
  proxy.fetch("/" + request.params[1], request.params[0], function( html ) {
* Copyright (c) 2012 Jacob Swartwood
* Licensed under the MIT license