Skip to content

Instantly share code, notes, and snippets.

@mizzy
Created April 9, 2013 08:24
Show Gist options
  • Select an option

  • Save mizzy/5343956 to your computer and use it in GitHub Desktop.

Select an option

Save mizzy/5343956 to your computer and use it in GitHub Desktop.
from twisted.internet.protocol import Protocol, Factory
from twisted.internet import reactor
class Echo(Protocol):
def dataReceived(self, data):
self.transport.write(data)
factory = Factory()
factory.protocol = Echo
reactor.listenTCP(8000, factory)
reactor.run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment