本文整理汇总了Python中dnslib.server.DNSLogger方法的典型用法代码示例。如果您正苦于以下问题:Python server.DNSLogger方法的具体用法?Python server.DNSLogger怎么用?Python server.DNSLogger使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dnslib.server
的用法示例。
在下文中一共展示了server.DNSLogger方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: run_dns_proxy
# 需要导入模块: from dnslib import server [as 别名]
# 或者: from dnslib.server import DNSLogger [as 别名]
def run_dns_proxy(self):
resolver = HTTPSResolver()
logger = DNSLogger()
server = DNSServer(resolver,
port=DNS_PORT,
address='localhost',
logger=logger)
server.start_thread()
while self.is_running:
# this just keeps the thing alive...
time.sleep(5)
server.stop()
示例2: __init__
# 需要导入模块: from dnslib import server [as 别名]
# 或者: from dnslib.server import DNSLogger [as 别名]
def __init__(self, server_addresses):
self._servers = []
for sa in server_addresses:
self._servers.append(
DNSServer(
resolver=DcosDnsResolver(),
address=sa[0],
port=sa[1],
logger=DNSLogger("pass"), # Don't log anything to stdout
)
)