-
Feature Request
-
Resolution: Done
-
Major
-
1.1.Beta7
-
None
Undertow provides handlers for various topics like LoadBalancerProxyHandler or a RequestLimitHandler, just as examples. Currently there is no download bandwidth throttling handler available. I believe that this is a important handler and would make Undertow
even more attractive.
THe handler should allow to define a download bandwidth at constructor level as well as providing a callback interface in which per connection a rate can be defined. Meaning, the user can implement an interface and is able to register this instance into the handler. The request information should be available for making per connection decision.
I already implemented a solution as servlet by implementing the token bucket algorithm. This algorithm works really good. Google provides a class called RateLimiter. A very good implementation of the algorithm. THis implementation also provides a warmup phase, so that the download rate not suddenly increases. Perhaps this could be a hint for the implementation.
Regards,
Ralf