I'm having trouble getting my VirtualHost instances to successfully
match requests based on the incoming port number. (I am using Restlet
1.2M1)

I set up a component with two servers, listening on two different
ports.   I then tried to configure a set of virtual hosts to match
requests, but only on particular ports:

getServers().add(Protocol.HTTP, 8888);
getServers().add(Protocol.HTTP, 9999);

VirtualHost hostA = new VirtualHost(getContext());
hostA.setHostDomain("www.A.com");
hostA.setHostPort(8888);
getHosts().add(hostA);
                
VirtualHost hostB = new VirtualHost(getContext());
hostB.setHostDomain("www.B.com");
hostB.setHostPort(9999);
getHosts().add(hostB);

Neither hostA nor hostB received any requests- all request got routed
to the default host.  When I removed the calls to setHost(), all
routing worked as expected.  However I want to make sure that I don't
respond to hostA on port 9999, and I don't want to respond to hostB on
port 8888.  Maybe I don't fully understand the VirtualHost
routing/matching process completely?

thanks,
  -Dave Fogel

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=1231485

Reply via email to