Jetty - 每个连接器的 ipaccess?

Jetty - ipaccess per connector?

假设我在 jetty 上启用 ipaccess 模块:

码头-ipaccess.xml

<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_3.dtd">

<!-- =============================================================== -->
<!-- The IP Access Handler -->
<!-- =============================================================== -->

<Configure id="Server" class="org.eclipse.jetty.server.Server">
<Call name="insertHandler">
<Arg>
<New id="IPAccessHandler" class="org.eclipse.jetty.server.handler.IPAccessHandler">
    <Set name="white">
     <Array type="String">
     <Item>127.0.0.1</Item>
     <Item>192.168.1.168</Item>    
     </Array>
    </Set>
    <Set name="whiteListByPath">false</Set>
</New>
</Arg>
</Call>
</Configure>

然后我用jetty/home/start.jar --add-to-start=ipaccess

启用它

但我希望此过滤器仅适用于 http 连接器。我不希望它应用于我的 https 连接器。

如何配置它,使其只影响 http 模块,而不影响 https 模块?

注意:在 Jetty 10 中,此 ipaccess 模块已替换为另一个模块:

https://github.com/eclipse/jetty.project/commit/3a4da94e1a69ee4c9cd3c936f50d58ee3440188e

答案是这还不可能,因为只有在使用程序化版本的 jetty 时,才能分配 IPAccessHandler 或 InetAccessHandler。当您使用 start.jar 启动它时不是。

所以我创建了问题:https://github.com/eclipse/jetty.project/issues/3562

我创建了一个 PR 来解决这个问题:https://github.com/eclipse/jetty.project/pull/3572

gregw@github took it and extended upon it here https://github.com/eclipse/jetty.project/pull/3576

一旦这是在 9.4.x 版本中,我将准备就绪。