Securing PyDoc and CGIHTTPserver

Irmen de Jong irmen at -NOSPAM-REMOVETHIS-xs4all.nl
Thu Jul 10 18:16:32 EDT 2003


Shane Hathaway wrote:

> What about binding only to the local (loopback) interface?  That way, 
> the system won't even listen for external connections.  It's like a 
> built-in firewall.
> 
> The change is a one-liner.  The DocServer computes the hostname for the 
> loopback interface but then binds to all interfaces.  So change this line:
> 
>   self.address = ('', port)
> 
> to:
> 
>   self.address = (host, port)
> 

I think Shane meant:

     self.address = ('localhost',port)


--Irmen de Jong





More information about the Python-list mailing list