How can i force Jetty to open all deployed webapps starting from specific virtual host like test.localhost:8080/myapp
instead of localhost:8181/myapp
?
Here's snippet from jetty.xml:
<Call name="addConnector">
<Arg>
<New class="org.eclipse.jetty.server.nio.SelectChannelConnector">
<Set name="host">
<Property name="jetty.host"/>
</Set>
<Set name="port">
<Property name="jetty.port" default="8181"/>
</Set>
...
... i tried to play with jetty.host
value but still no success. :(
How to?
To LISTEN on a specific network interface, you specify that interface either via its IP address (IPv4 or IPv6) or its hostname.
Since this is a variant of localhost / loopback, then using IP address would be best.
Eg:
Yes, those hosts are on different IPs, intentionally (and valid for the loopback interface).
You could then setup the connector, using the jetty-distribution, for
test.localhost:8080
by using the command line (this is jetty 9 syntax)You can also put those command line options into your
${jetty.base}/start.ini
as separate lines.Once jetty is started, you can see what interface it is listening on