Skip Menu |

This queue is for tickets about the HTTP-Server-Simple CPAN distribution.

Report information
The Basics
Id: 72987
Status: open
Priority: 0/
Queue: HTTP-Server-Simple

People
Owner: Nobody in particular
Requestors: 'spro^^*%*^6ut# [...] &$%*c
Cc: DMITRI [...] cpan.org
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Subject: Automatic port number selection
It would be nice if HTTP::Server::Simple let me start the server on a port selected by the system, so I don’t have to hard-code it or use random number and hope it’s not in use. I’ve found that passing '00' as the port number will accomplish that, but then finding out the number requires delving into HTTP::Server::Simple’s guts.
On Mon Dec 05 21:25:33 2011, SPROUT wrote: Show quoted text
> It would be nice if HTTP::Server::Simple let me start the server on a > port selected by the system, > so I don’t have to hard-code it or use random number and hope it’s not > in use. > > I’ve found that passing '00' as the port number will accomplish that, > but then finding out the > number requires delving into HTTP::Server::Simple’s guts. >
BTW, this is what I currently use: my($port) = Socket::sockaddr_in getsockname HTTP::Server::Simple::HTTPDaemon;