I am trying to bind Jetty to listen only to IPv6 address. I am using Jetty 7.4.2.v20110526.
my jetty.xml:
<Call name="addConnector">
<Arg>
<New class="org.eclipse.jetty.server.nio.SelectChannelConnector">
<Set name="host">::1</Set>
<Set name="port"><SystemProperty name="jetty.port" default="8070"/></Set>
<Set name="maxIdleTime">30000</Set>
<Set name="Acceptors">2</Set>
<Set name="confidentialPort">8443</Set>
</New>
</Arg>
</Call>
the error I get:
java.net.SocketException@3d3c4c09: Address family not supported by protocol family: bind;
at sun.nio.ch.Net.bind(Native Method)
java.net.SocketException: Address family not supported by protocol family: bind
at sun.nio.ch.Net.bind(Native Method)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:119)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:59)
at org.eclipse.jetty.server.nio.SelectChannelConnector.open(SelectChannelConnector.java:172)
at org.eclipse.jetty.server.AbstractConnector.doStart(AbstractConnector.java:297)
at org.eclipse.jetty.server.nio.SelectChannelConnector.doStart(SelectChannelConnector.java:250)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:58)
at org.eclipse.jetty.server.Server.doStart(Server.java:269)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:58)
I have tried both ::1
and [::1]
How can I bind Jetty to IPv6 address? Is IPv6 supported by Jetty at all?