Skip to main content

DNS over HTTPS based on aiohttp and async_dns

Project description

async-doh

PyPI

DNS over HTTPS based on aiohttp and async_dns.

Installation

$ pip install async-doh

Usage

Client

import asyncio
from async_doh.client import query

async def main():
    result = await query('https://1.1.1.1/dns-query', 'www.google.com', 'A')
    print('query:', result)
    result = await query_json('https://1.1.1.1/dns-query', 'www.google.com', 'A')
    print('query_json:', result)

asyncio.run(main())

Server

from aiohttp import web
from async_doh.server import application

web.run(application)

Now you have http://localhost:8080/dns-query as an endpoint.

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

async-doh-0.1.0.tar.gz (2.7 kB view hashes)

Uploaded Source

Built Distribution

async_doh-0.1.0-py3-none-any.whl (3.1 kB view hashes)

Uploaded Python 3

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