Bind Jetty to IPv6 address

后端 未结 2 1037
一个人的身影
一个人的身影 2021-01-21 04:12

I am trying to bind Jetty to listen only to IPv6 address. I am using Jetty 7.4.2.v20110526.

my jetty.xml:


  

        
相关标签:
2条回答
  • 2021-01-21 04:41

    If you haven't found a solution, here it is. Change the NIO connector with the IO one. Instead of using "org.mortbay.jetty.nio.SelectChannelConnector" use "org.mortbay.jetty.bio.SocketConnector" and the overall connector config will be:

    <Call name="addConnector">
      <Arg>
          <New class="org.mortbay.jetty.bio.SocketConnector">
            <Set name="port"><SystemProperty name="jetty.port" default="8070"/></Set>
            <Set name="maxIdleTime">50000</Set>
            <Set name="lowResourceMaxIdleTime">1500</Set>
          </New>
      </Arg>
    </Call>
    

    This way you will be able to access the webpage using both IPv4 and IPv6 address. Hope this helps.

    0 讨论(0)
  • 2021-01-21 04:51

    Old versions of the Sun JRE do not support IPv6 on NIO channels, so simply upgrade the JVM.

    http://bugs.sun.com/view_bug.do?bug_id=6230761

    0 讨论(0)
提交回复
热议问题