from twisted.internet import protocol, reactor

factory = protocol.ServerFactory()
factory.protocol = protocol.Protocol

reactor.listenTCP(8000, factory)
reactor.run()

from twisted.internet import endpoints, protocol, reactor

class UpperProtocol(protocol.Protocol):
    pass

factory = protocol.ServerFactory()
factory.protocol = UpperProtocol

endpoints.serverFromString(reactor, 'tcp:8000').listen(factory)
reactor.run()

Convert to endpoints API and use custom protocol class
Convert to endpoints API and use custom protocol class
