Intercepting, Recording, Replaying HTTP Proxy
MIT License
$ npm install irrlicht
Travis CI
Irrlicht
might not run on Travis CI out of the box.
If you run into problems, add the following lines to your .travis.yml
to work around this issue:
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-4.8
env:
CXX=g++-4.8
$ npm install --global irrlicht
Usage: irrlicht [command] [options]
Commands:
record Record HTTP responses (implies MITM, no-cache)
replay Replay recorded HTTP responses (implies MITM)
Options:
--help, -h Show help
--version, -v Show version number
--port, -p Port to run the proxy on [default: 8989]
--host, -H Hostname to bind to
--enable-cache Disable forced cache revalidation [default: false]
--disable-network Enable proxying to remotes during replay [default: true]
--ignore-local Record & replay on local interfaces [default: true]
--fixtures, -f Fixture data path
--mitm Enable MITM on SSL/TLS [default: false]
--ca SSL CA Certificate path
--cert SSL Certificate path
--key SSL Certificate Key path
var Irrlicht = require( 'irrlicht' )
var proxy = new Irrlicht( options )
// Start listening on a given port (and optionally, host)
proxy.listen( port[, host], function() {
console.log( 'Proxying HTTP via', this.http.address() )
console.log( 'Proxying HTTPS via', this.https.address() )
})
new Irrlicht( options )
options
:
record
: Record HTTP responsesreplay
: Replay saved HTTP responsesenableNetwork
: Enable proxying to remotes during HTTP replayignoreLocal
: Record & replay responses to local network interfacespath
: Fixture data pathnoCache
: Force cache revalidationmaxSockets
: Maximum number of sockets for each serverssl
: For more detail, see iojs.org/api/tls
key
: The private key of the server in PEM formatcert
: The certificate key of the server in PEM formatca
: Trusted certificates in PEM formatcrl
: PEM encoded CRs (Certificate Revocation List)ciphers
: The ciphers to use or exclude, seperated by :
socket
: Filename of HTTPS sockethttpAgent
: HTTP socket pooling agenthttpsAgent
: HTTPS socket pooling agenthttp
: HTTP serverhttps
: HTTPS serverrecord
: Record HTTP responsesreplay
: Replay saved HTTP responsespath
: Fixture data pathenableNetwork
: Enable proxying to remotes during HTTP replayignoreLocal
: Record & replay responses to local network interfacesnoCache
: Force cache revalidationmitm
: MITM SSL/TLS connectionsgetRequestOptions( req )
handleConnect( req, socket, head )
handleRequest( req, res )
proxyRequest( req, res[, options] )
recordRequest( req, res[, options] )
replayRequest( req, res[, options] )
listen( port[, host][, callback] )
close( [callback] )
error
( error )request
( request, response )response
( request, remoteResponse )listening
close
( error )