[Twisted-Python] Re: Binding echo server to a particular ip address

Morrow, Paul Paul.Morrow at loyaltyworks.com
Wed May 14 14:03:36 EDT 2003


Indeed!

-----Original Message-----
From: W.J. [mailto:miathan at goliath.darktech.org] 
Sent: Wednesday, May 14, 2003 1:48 PM
To: twisted-python at twistedmatrix.com
Subject: [Twisted-Python] Re: Binding echo server to a particular ip
address



> The following is your simpleserv.py echo server example.  On a 
> multihost (multiple ip addresses) server, how would I have it listen 
> on a particular ip address?

> def main():
>     """This runs the protocol on port 8000"""
>     factory =3D protocol.ServerFactory()
>     factory.protocol =3D Echo

>     reactor.listenTCP(8000,factory)

reactor.listenTCP(8000, factory, interface="127.0.0.1")

Where 127.0.0.1 is the interface you want to bind to.
Almost too easy uh?

>     reactor.run()

Wladimir



_______________________________________________
Twisted-Python mailing list
Twisted-Python at twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python




More information about the Twisted-Python mailing list