proxy.plugin.cloudflare_dns module#

⚡⚡⚡ Fast, Lightweight, Pluggable, TLS interception capable proxy server focused on Network monitoring, controls & Application development, testing, debugging.

  1. 2013-present by Abhinav Singh and contributors.


BSD, see LICENSE for more details.

class proxy.plugin.cloudflare_dns.CloudflareDnsResolverPlugin(uid: str, flags: argparse.Namespace, client: proxy.http.connection.HttpClientConnection, event_queue: proxy.core.event.queue.EventQueue, upstream_conn_pool: Optional[UpstreamConnectionPool] = None)[source]#

Bases: proxy.http.proxy.plugin.HttpProxyBasePlugin

This plugin uses Cloudflare DNS resolver to provide protection against malware and adult content. Implementation uses DoH specification.

See See


For this plugin to work, make sure to bypass proxy for


This plugin requires additional dependency because DoH mandates a HTTP2 complaint client. Install httpx dependency as:

pip install "httpx[http2]"
_abc_impl = <_abc._abc_data object>#
resolve_dns(host: str, port: int) Tuple[Optional[str], Optional[Tuple[str, int]]][source]#

Resolve upstream server host to an IP address.

Optionally also override the source address to use for connection with upstream server.

For upstream IP: Return None to use default resolver available to the system. Return IP address as string to use your custom resolver.

For source address: Return None to use default source address Return 2-tuple representing (host, port) to use as source address