Alex,

> > The "serverAddress" property indeed does comparisons based on the
> > numerical IP address. There are some convenience static methods on
> > VirtualHost:
> >  - getLocalHostAddress()
> >  - getIpAddress(String domain)
> 
> This seems a bit inconsistent that you can use hostname when 
> adding a server:
> 
>    getServers().add(Protocol.HTTPS,"localhost",8080);
> 
> but you have to use a numeric ip addresses with 
> setServerAddress on VirtualHost:
> 
>    vhost.setServerAddress("127.0.0.1");

The problem is that the mapping between domain name and IP address isn't
symetric. One IP can be mapped to several domain names. However, a domain
name maps to one and only one IP.

Hence, using a domain name when adding a server is just a shortcut for
adding the equivalent IP address.
 
> InetAddress will do the right thing and handle both domain 
> names and numeric
> ip addresses and so this would be easy to implement as 
> either.  Internally,
> we could resolve any domain names to a specific numeric ip 
> address and use
> that for matching.

I'm open to enhancement on this front. Are you thinking about adding more
constructors or to change the way we internally store the IP/domain names,
like the Server.address property?

Best regards,
Jerome  

Reply via email to