Is there any way to pause the request before sending to server and then forward it or drop it
Plese fill the template when you reporting a new issue, thanks!
Which platform are you running AnyProxy
Windows
The version of the AnyProxy
4.0.9
Your expected behavior of AnyProxy
Is there any way to pause the request before sending to server and then forward it or drop it. For example in burp suit , in that we can turn intercept on and off which lets us pause and forward request. I am using electron to develop simple intercept project.
The actual behavior of AnyProxy
The log of the error
Hi @impraveensingh Maybe the Rule Interface can help you, by rule you can do the program before sending the request.
Hey, Thanks for quick response, I used the below code but, i was not able to pause the request.
var interceptrules = module.exports = { * beforeSendRequest(requestDetail) { requestDetail._req.client.server.pauseOnConnect = true; }, * beforeSendResponse(requestDetail, responseDetail) { } };
Try this
function delay(ms, re) {
return function(callback) {
setTimeout(() => {
callback(re);
}, ms);
}
}
module.exports = {
* beforeSendRequest(requestDetail) {
//let re = yield new Promise(resolve => {
//setTimeout(() => resolve(null), 5000);
//});
let re= yield delay(5000, null);
return re;
},
}