Skip to main content

DNS over HTTPS reslover for aiohttp

Project description

DNS over HTTPS reslover for aiohttp

Installation

$ pip install aiohttp-doh

Usage

# You just replace aiohttp.ClientSession to aiohttp_doh.ClientSession
from aiohttp_doh import ClientSession

async def main():
    async with ClientSession() as session:
        async with session.get('http://example.com') as resp:
            data = await resp.text()

    print(data)

Configuration

You can pass some options by parameters of ClientSession.

endpoint

DNS over HTTPS endpoint. default is ‘https://dns.google.com/resolve’. You can also use others instead.

json_loads

Function for loads json. default is Python builtin json module’s one.

resolver_class

Internal DNS resolver class. Using for connect to endpoint. default is aiohttp default.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aiohttp-doh-0.0.0.tar.gz (2.4 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page