Virtual Host support on the embedded HTTP server

Christopher Hegarty - Sun Microsystems Ireland Christopher.Hegarty at Sun.COM
Mon Dec 14 05:28:28 PST 2009


Hi David,

I looked at the proposal and it looks pretty good, I just have a few 
concerns.

HttpHost can be a virtual or real host, and HttpServer is an instance of 
a HTTP server running a virtual host. I think this concept is used in 
webservers like apache and Sun webserver. I always found it a little 
confusing, and I'm a little concerned that it will just confuse users of 
this simple http server API. Considering I wouldn't expect may users to 
use this advanced feature.

I wonder if we could rework a simpler approach, maybe just simple name 
based virtual server? Possibly:
   HttpContext createContext(String host, String path, HttpHandler handler)

Also, we need to think of the implications on HttpsServer.

Michael (cc'ed) is the author of this API. Maybe he has an opinion.

-Chris.

On 07/12/2009 11:23, Christopher Hegarty - Sun Microsystems Ireland wrote:
> This is certainly interesting. Let me take a look and I'll get back to 
> you later.
> 
> -Chris.
> 
> On 04/12/2009 20:17, David M. Lloyd wrote:
>> I've crafted a simple patch which extends the API of the embedded HTTP 
>> server to support virtual hosts.  The patch is designed to add the new 
>> functionality without breaking existing implementations which do not 
>> support virtual hosts, or code which uses the HttpServer API today.  
>> It does not include an implementation; however, the default 
>> implementation should be easy to extend, from a brief look over the code.
>>
>> The patch is attached.  Please let me know what you think.
>>
>> - DML
>>



More information about the net-dev mailing list