Module for tracing HTTP requests
npm install http-tracer`npm install http-tracer
Then just enable http-tracer and make your requests as usual. Disable tracing afterwards if you don't need one.
`js
const httpTracer = require('http-tracer');
const got = reuqire('got'); // or any another request library
httpTracer.enable();
got('http://registry.npmjs.org/http-tracer')
.then(() => {
httpTracer.disable();
});
`
Example of script output:
Array of regexps or strings to ignore
`js`
httpTracer.enable({
ignore: [
/myhost\.com/,
'http://registry.npmjs.org/npm'
]
});
`jsrequest on ${options.host}!
httpTracer.enable({}, (options, req){
console.log();`
});
http-tracer` is compatible with any module using http.request function (https, got, asker, etc.).