Exemple #1
0
class PoolServerFactory(Factory):
    def __init__(self):
        self.initialised = False

        # pool handling
        self.pool_service = None

        self.tac = None

        # NAT service
        self.nat = NATService()

    def startFactory(self):
        # start the pool thread with default configs
        self.pool_service = PoolService(self.nat)
        self.pool_service.start_pool()

    def stopFactory(self):
        log.msg(eventid="cowrie.backend_pool.server",
                format="Stopping backend pool...")

        self.pool_service.shutdown_pool()

    def buildProtocol(self, addr):
        log.msg(
            eventid="cowrie.backend_pool.server",
            format="Received connection from %(host)s:%(port)s",
            host=addr.host,
            port=addr.port,
        )
        return PoolServer(self)
Exemple #2
0
 def startFactory(self):
     # start the pool thread with default configs
     self.pool_service = PoolService(self.nat)
     self.pool_service.start_pool()