[Twisted-Python] Re: how to only accept local computer requests?

Nicola Larosa nico at tekNico.net
Tue May 9 09:15:39 MDT 2006


> I have a python server with twisted framework running
> 24x7. I want to have a config file to setup accepting local
> computer requests or remote computer requests.

When you create instances of twisted.internet.application.TCPServer or
.SSLServer, pass the keyword parameter

interface = '127.0.0.1'

and the server socket will only bind to the localhost interface. If you
don't pass the parameter, the socket will bind to all interfaces.

-- 
Nicola Larosa - http://www.tekNico.net/

In high school she already wanted to be a doctor. And she is so ambitious
and determined that she overcame every obstacle along the way -- including,
unfortunately, not liking it. Now she has a life chosen for her by
a high-school kid. -- Paul Graham, January 2006






More information about the Twisted-Python mailing list