我是ODL控制器和嵌入式码头的新手。如果有大量请求,我想在jetty.xml中添加DoSFilter来限制REST请求。
我曾尝试搜索互联网,但是在web.xml DoSFilter中有很多配置它的示例,但对jetty.xml却没有太大帮助
在jetty.xml中配置DoSFilter的任何帮助都会有很大帮助。
ODL-氮气版本
Jetty-9.2.21.X版本
您可以使用jetty-web.xml并按照定义的here配置过滤器>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_3.dtd">
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
<filter>
<filter-name>DoSFilter</filter-name>
<filter-class>org.eclipse.jetty.servlets.DoSFilter</filter-class>
<init-param>
<param-name>maxRequestsPerSec</param-name>
<param-value>30</param-value>
</init-param>
</filter>
</Configure