rpc_client.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:BrundleFuzz 作者: carlosgprado 项目源码 文件源码
def __init__(self, parent):
        """
        This module will communicate via RPC
        with RabbitMQ and ultimately with
        our fuzzing server
        """
        self.parent = parent
        self.ae = parent.ae
        self.cfg = parent.cfg
        host = self.cfg.get('server_info', 'host')

        credentials = pika.PlainCredentials(
            self.cfg.get('server_info', 'user'),
            self.cfg.get('server_info', 'pass'))

        try:
            self.connection = pika.BlockingConnection(pika.ConnectionParameters(
                host = host,
                credentials = credentials,
                retry_delay = 10,
                connection_attempts = 5))

            self.ae.m_ok("Connected to server (broker): %s" % host)

        except Exception as e:
            self.ae.m_fatal("Could not connect to server")
            self.ae.m_fatal(e)

        self.channel = self.connection.channel()
        result = self.channel.queue_declare(exclusive = True)
        self.callback_queue = result.method.queue

        self.channel.basic_consume(self.on_response, no_ack = True,
                                   queue = self.callback_queue)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号