[tpm] IO::Socket::INET listening on the 2nd ip address

Antonio Sun antoniosun at lavabit.com
Tue Feb 8 06:03:47 PST 2011


Hi,

I have the following code,

 $sock = new IO::Socket::INET (  LocalHost => '0.0.0.0',
                                LocalPort => '80',
                                Proto => 'tcp',
                                Listen => 30,
                                Reuse => 1);

which will fail because my port 80 on localhost is used by web server.
How can I change the code to listen on the 2nd ip address?

I.e., my current IP address is 192.168.0.100, it is
also accessible at 192.168.0.101. I want that visiting 192.168.0.100 will
land to my normal web server, while visiting 192.168.0.101 will be handled
by the code above.

Please help.

Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/toronto-pm/attachments/20110208/4e3b10c6/attachment.html>


More information about the toronto-pm mailing list