如何在ODL控制器中配置拒绝服务过滤器

问题描述 投票:0回答:1

我是ODL控制器和嵌入式码头的新手。如果有大量请求,我想在jetty.xml中添加DoSFilter来限制REST请求。

我曾尝试搜索互联网,但是在web.xml DoSFilter中有很多配置它的示例,但对jetty.xml却没有太大帮助

在jetty.xml中配置DoSFilter的任何帮助都会有很大帮助。

ODL-氮气版本

Jetty-9.2.21.X版本

java servlets jetty embedded-jetty opendaylight
1个回答
0
投票

您可以使用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
© www.soinside.com 2019 - 2024. All rights reserved.