コード例 #1
0
ファイル: pool_server.py プロジェクト: yp2800/cowrie
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)
コード例 #2
0
ファイル: pool_server.py プロジェクト: yp2800/cowrie
 def startFactory(self):
     # start the pool thread with default configs
     self.pool_service = PoolService(self.nat)
     self.pool_service.start_pool()