newbie - SOAP.py sockets and localhost?

Alex Martelli aleax at aleax.it
Tue May 14 05:33:44 EDT 2002


Duncan Grisby wrote:
        ...
> For some reason I don't understand, most Python socket examples give
> the socket connection tuple as ("localhost", port). That tells the
> server to _only_ listen on the localhost interface, meaning remote
> clients can't connect. The correct thing to do is to use an empty

I think it's a good default to use in examples: by following the
example, people who don't know what they're doing will not be
opening an unsafe service on their machine to the world at large,
even if they're not behind appropriate firewalls etc.

> string like ("", port) since that causes it to listen on all network
> interfaces.

<nod> yes, but only do it once you DO understand the security
implications of that and are satisfied that you're not running
real risks (e.g., because your firewall is good and well configured).


Alex




More information about the Python-list mailing list