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
This is achieved by pointing the application or browser to the capture-proxy which will then forward the request onto the target endpoint.
$ npm install -g capture-proxy
Capturing Requests and Responses
Capture HttpRequests and HttpResponses using the capture command.
Usage: capture <applicationRoot> [options] Commands: replay [options] Re-issue a request from a previously recorded file alias Save a request file as a global alias that can be referenced from any location on the system Options: -h, --help output usage information -V, --version output the version number -p, --port <portNumber> Port number to start listening on  -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 certs -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. http://my.host.com/application/root/)
# mount http://localhost:3000/ # save both requests and responses to ./captures folder $ capture http://www.google.com/ -p 3000 -R -o ./captures
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] 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
# 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
Usage: alias <alias> <requestFile> Options: -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
- Binary data - don't currently know how to handle binary data when it comes to replaying requests
- Running the proxy under