In message <200205250747.g4P7lArF075573@miso.k.notwork.org>,
`GOTO Kentaro <gotoken@notwork.org>' wrote:
> At Thu, 23 May 2002 14:27:34 +0200,
> Lars Christensen wrote:
> > If you want to run the webrick server on multiple interfaces and take different
> > actions depending on which interface the request is made on, you would need the
> > Socket#addr information. The alternative, to start a server on each of the
> > interfaces seems to me a bit of overkill in, at least, my situtation.
>
> Another option is stating servers with explicit :BindAddress.
> localhost = HTTPServer.new(:BindAddress => "localhost", ...)
> lan = HTTPServer.new(:BindAddress => addr1, ...)
> internet = HTTPServer.new(:BindAddress => addr2, ...)
Hmm, :BindAddress is not a good solution for virtual host.
The specified address is not local address and same port
cannot be bound twice.
The purpose of :BindAddress is multiplexing IPv4 and IPv6 on
some platforms which doesn't enable IPv4-mapped IPv6
address. (e.g. NetBSD, OpenBSD)
> Anyway, I've got to think of adding an API to give local address
> infomation ;) What do you think, Yuzo?
>
> What name is better? localaddr, addr or something else?
`addr' seems to match with TCPSocket#addr.
In CVS version, HTTPRequest#addr and HTTPRequest#absolute_uri
are there. absolute_uri returns absolute form of request_uri.
And now, I made tarball of latest CVS snapshot.
If critical bug is not there it will be version 1.2.0.
http://www.notwork.org/ipr/webrick/src/webrick-20020528.tar.gz
--
gotoyuzo