Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] How to Jetty server listen on multiple IP addresses

Hi Simone, 

I'm chasing the same problem as the original post. And inspired by Uwe's reply, I managed to get it to work by duplicating the "connector" instantiation code in jetty-ssl.xml and creating 2 jetty-https.xml files (please see my detailed steps below). This seems to work perfectly, but I'm just curious about how my solution differs from yours. Is better encapsulation the only difference here by creating a customized module? Many thanks in advance!

1. Copy over jetty-ssl.xml from ${JETTY_HOME}/etc to${JETTY_BASE}/etc
2. Duplicate the “addConnector” block so that 2 connectors will be created
3. Copy over jetty-https.xml from ${JETTY_HOME}/etc to ${JETTY_BASE}/etc
4. Duplicate jetty-https.xml to correspond to the 2 connectors. Say the second XML is named as jetty-https-2.xml
5. Update the connector ID field in jetty-https.xml files accordingly
6. Add jetty-https-2.xml to ${JETTY_BASE}/start.d/https.ini


On Sun, May 14, 2023 at 9:38 AM Simone Bordet <sbordet@xxxxxxxxxxx> wrote:

On Thu, May 11, 2023 at 12:19 PM ihonda--- via jetty-users
<jetty-users@xxxxxxxxxxx> wrote:
> Requirement is we want this configuration flexible. For example, we want to
> listen on multiple addresses on the interface.
> This kind of setting is not valid.
> How can I enable listen(bind) on multiple host address ?

Use different `ServerConnector` instances with each a different host,
but all having the same port and the property

You can write a custom module following these instructions:

Simone Bordet
Developer advice, training, services and support
from the Jetty & CometD experts.
jetty-users mailing list
To unsubscribe from this list, visit

Back to the top