假设我在jetty上启用了ipaccess模块:
jetty-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
发布于 2019-04-19 10:58:47
答案是,这还不可能,因为只有在使用jetty的编程版本时才能分配IPAccessHandler或InetAccessHandler。当你用start.jar启动它的时候就不是了。
所以我创建了一个问题:https://github.com/eclipse/jetty.project/issues/3562
我创建了一个PR来修复这个问题:https://github.com/eclipse/jetty.project/pull/3572
gregw@github拿走了它,在这里扩展了它,https://github.com/eclipse/jetty.project/pull/3576
一旦进入9.4.x发行版,我将全部设置好。
https://stackoverflow.com/questions/55622306
复制相似问题