proxy.plugin.custom_dns_resolver module#

proxy.py#

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

copyright
  1. 2013-present by Abhinav Singh and contributors.

license

BSD, see LICENSE for more details.

class proxy.plugin.custom_dns_resolver.CustomDnsResolverPlugin(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 demonstrate how to use your own custom DNS resolver.

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

Here we are using in-built python resolver for demonstration.

Ideally you would like to query your custom DNS server or even use DoH to make real sense out of this plugin.

The second parameter returned is None. Return a 2-tuple to configure underlying interface to use for connection to the upstream server.