Skip to content

Contains utils to do both, implement throttling on the server side as well as handling throttling on the client side. Project initially was drafted during my masters thesis.

License

Notifications You must be signed in to change notification settings

pzzz/throttling-utils

Repository files navigation

throttling-utils

Jenkins Build Status JaCoCo Coverage Spotbugs Results Checkstyle Results

Framework and library to do both:

  • handle throttling at the client side
  • implement throttling at a server side

Usage

Can be used as a servlet filter via web.xml

<filter>
  <filter-name>spikeArrest</filter-name>
  <filter-class>de.pzzz.throttling.utils.servlet.IpThrottlingServletFilter</filter-class>
  <init-param>
    <param-name>limit</param-name>
    <param-value>3</param-value>
  </init-param>
	<init-param>
		<param-name>duration</param-name>
		<param-value>10</param-value>
	</init-param>
</filter>
<filter-mapping>
	<filter-name>spikeArrest</filter-name>
	<url-pattern>/*</url-pattern>
</filter-mapping>

or directly in the code from a ServletContextListener

@Override
public void contextInitialized(ServletContextEvent event) {
	ServletContext context = event.getServletContext();
	context.addFilter("spikeArrest", new IpThrottlingServletFilter());
}

About

Contains utils to do both, implement throttling on the server side as well as handling throttling on the client side. Project initially was drafted during my masters thesis.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages