Subject: | HTTP::Daemon returns resolved hostname rather than localhost |
I'm running strawberry perl 5.8... on windows.
The following code:
my $d = HTTP::Daemon->new( LocalAddr => "localhost" ) || die;
print "Please contact me at: <URL:", $d->url, ">\n";
Appears to print for the url the name of the windows pc i'm sitting at
rather than the hostname.
On the pc I'm sitting at, the url returned isn't reachable, and the
connection times out if I attempt to get to http://servername:$port/ (
ie the return value of $d->url ) ....
if, however I go via http://localhost:$port/ ( what I asked for )
everything works as expected.
This behavour appears to break the tests for WWW::Mechanize on
strawberry perl 5.8 - preventing installation of this package, packages
which depend on it, and hanging the CPAN shell in the process. After a
casual look at the source and docs of HTTP::Deamon I can't see a method
returning either the port or the hostname specified in the constructor,
otherwise I could have sent a nice patch to the owner of WWW::Mechanize.
There are a few different ways of implementing what looks to me like a
simple fix - I assume the behavour of $d->url may be relied upon
elsewhere and hence adding either a method to return $port, or another
one to behave as $d->url, but instead returning the requested address
passed in the constructor would assist greatly in this.
Its a shame because it prevents installation of some modules on
strawberry perl which raises the barrier of entry to this variety of
perl on windows.