A basic proxy that can be used during development to record requests and responses
Switch branches/tags
Nothing to show
Clone or download
socsieng Merge pull request #9 from breedx2/host_binding
Add option to bind to all interfaces, not just localhost
Latest commit 6697261 Nov 7, 2017



Build Status

capture-proxy is a basic nodejs proxy that allows requests and responses to be captured and optionally replayed at another point in time like the curl command.

This is achieved by pointing the application or browser to the capture-proxy which will then forward the request onto the target endpoint.


Using npm:

$ npm install -g capture-proxy

Capturing Requests and Responses

Capture HttpRequests and HttpResponses using the capture command.

  Usage: capture <applicationRoot> [options]


    replay [options]       Re-issue a request from a previously recorded
    alias                  Save a request file as a global alias that can
                           be referenced from any location on the system


    -h, --help               output usage information
    -V, --version            output the version number
    -p, --port <portNumber>  Port number to start listening on [8000]
    -r, --response           Save responses
    -R, --request            Save requests and responses
    -o, --output [location]  When request or response capture is enabled,
                             save files to this folder [./output]
    -k, --insecure           Allow connections to SSL sites without valid
    -z, --zip                Enable compression. By default the
                             `accept-encoding` header is removed
    -v, --verbose            Output requests and responses

Capture is a http proxy that can be used to intercept http requests and
persist the request and response payloads.

<applicationRoot> is the mounting point for the proxy. (e.g.


# mount http://localhost:3000/
# save both requests and responses to ./captures folder
$ capture http://www.google.com/ -p 3000 -R -o ./captures

Other Commands


Replay can be used as an alternative to curl. It condenses many of the different curl options into a HttpRequest file.

  Usage: replay <file|alias> [options]


    -h, --help      output usage information
    -H, --headers   Output headers
    -k, --insecure  Allow connections to SSL sites without valid certs
    -v, --verbose   Output requests


Replay by file

# load the contents of ./captures/home.req an re-issue the request
# ignoring SSL errors
$ capture replay ./captures/home.req -k

Replay by alias

# load an aliased request named `myAlias` and re-issue it
$ capture replay myAlias


Saves a HttpRequest file as an alias that can be later used with the replay command

  Usage: alias <alias> <requestFile>


    -h, --help  output usage information


# create the alias `myAlias` for request file ./captures/home.req
$ capture alias myAlias ./captures/home.req


Sometimes fiddler isn't an option. This is a very crude and basic alternative to inspecting the requests and responses driven by a personal need to reverse engineer the invokation of SOAP services.


  • It will handle basic web page requests however static resource references are still a problem
  • Cookie management
  • Redirects
  • Binary data - don't currently know how to handle binary data when it comes to replaying requests


  • Running the proxy under https