browsermob-proxy icon indicating copy to clipboard operation
browsermob-proxy copied to clipboard

Add possibility to remove RequestFilter

Open tommywo opened this issue 10 years ago • 3 comments

Hi, I would like to do something like this:

MyRequestFilter myRequestFilter = new MyRequestFilter();
proxy.addRequestFilter(myRequestFilter);
//do something using proxy with myRequestFilter
proxy.removeRequestFilter(myRequestFilter);
// do something using proxy without myRequestFilter

Can you add this functionality?

tommywo avatar Sep 24 '15 07:09 tommywo

I think this is a great idea! It's slightly more complicated than you'd think, because of the way LittleProxy's filters and filter factories work. I've also considered perhaps having the addRequestFilter() method return a filter ID that can be used to disable or delete the filter later, which would be much friendlier for the REST API.

I think we'll probably get to this when we start modifying the REST API, which will most likely be part of the 2.2 release. In the meantime I'd be happy to entertain any PRs that work within the existing design!

jekh avatar Sep 26 '15 22:09 jekh

Hi, first of all thank-you so much for building this awesome tool. I was wondering if this request got implemented? If yes, pardon my negligence. Thank you once again.

chaudharydeepak avatar Jul 08 '21 03:07 chaudharydeepak

I don't think this feature has been implemented yet as I have not come across a way to do so via the api. Would anyone know of a work-around? Besides stopping/restarting the proxy.

asaunders-els avatar Feb 16 '22 16:02 asaunders-els