from twisted.internet import protocol from twisted.conch.insults import insults from twisted.conch.telnet import TelnetTransport, TelnetBootstrapProtocol from twisted.conch.manhole import ColoredManhole f = protocol.ServerFactory() f.protocol = lambda : TelnetTransport( TelnetBootstrapProtocol, insults.ServerProtocol, ColoredManhole ) test = internet.TCPServer( port = 6023, factory = f ) test.setServiceParent( application )