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

[Feature Request]: Add Timer/Time Out option to stop dev proxy

Open OnurGumus opened this issue 1 year ago • 3 comments

It would be nice to add some sort of timer, that devproxy stops itself after that time passes as an additional safety net where it can be left open, in particular in CI/CD scenarios.

devproxy --timer 180  
// will stop dev proxy after 3 minutes

OnurGumus avatar Aug 08 '24 08:08 OnurGumus

Thanks for the suggestion @OnurGumus. Could you give us some more information behind the thinking and how you'd prefer this over explicitly closing proxy by sending a SIGINT?

waldekmastykarz avatar Aug 09 '24 06:08 waldekmastykarz

Hi,

I was thinking something like timeout command on linux. But perhaps triggers if there are no requests for given duration. It's a sort of safety net against devproxy left open.

OnurGumus avatar Aug 09 '24 11:08 OnurGumus

Thanks for clarifying. Nice suggestion!

waldekmastykarz avatar Aug 13 '24 06:08 waldekmastykarz

Hi, can i give it a try? I would implement as @OnurGumus suggested and use the event in the ProxyEngine to listen to BeforeRequest and reset a timer on it(--timeout sets the seconds as long to which the timer will be reset at a request), when the timer is expired i would call "StopProxy".

joshua-siw avatar Feb 16 '25 05:02 joshua-siw

Cool! Please do @joshua-siw. Looking forward to seeing what you'll build.

waldekmastykarz avatar Feb 16 '25 14:02 waldekmastykarz