Skip to content

Commit

Permalink
Use custom http-mitm-proxy version that implements onRequestEnd
Browse files Browse the repository at this point in the history
  • Loading branch information
kdzwinel committed Dec 29, 2015
1 parent 2c69709 commit b117ed7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion lib/traffic-interceptor.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,14 @@ function handleIncomingRequest(ctx, callback) {
ctx.onRequestData(function(ctx, chunk, callback) {
chunks.push(chunk);

return callback(null, chunk);
});

ctx.onRequestEnd(function(ctx, callback) {
connection.setRequest(ctx.clientToProxyRequest, ctx.isSSL, (Buffer.concat(chunks)).toString());
trafficInterceptor.emit('request', connection);

return callback(null, chunk);
return callback();
});

return callback();
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"homepage": "https://github.com/kdzwinel/betwixt",
"dependencies": {
"chalk": "^1.1.1",
"http-mitm-proxy": "^0.2.0",
"http-mitm-proxy": "git://github.com/kdzwinel/node-http-mitm-proxy.git#onRequestEnd",
"istextorbinary": "^1.0.2"
},
"devDependencies": {
Expand Down

0 comments on commit b117ed7

Please sign in to comment.