1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
|
aiohttp-asyncmdnsresolver
=========================
Introduction
------------
This module provides an ``aiohttp`` resolver that supports mDNS, which uses the ``zeroconf`` library
to resolve mDNS queries.
For full documentation please read https://aiohttp-asyncmdnsresolver.readthedocs.io.
Installation
------------
.. code-block:: console
$ pip install aiohttp-asyncmdnsresolver
Quick start
-----------
.. code-block:: python
import asyncio
import aiohttp
from aiohttp_asyncmdnsresolver.api import AsyncMDNSResolver
async def main():
resolver = AsyncMDNSResolver()
connector = aiohttp.TCPConnector(resolver=resolver)
async with aiohttp.ClientSession(connector=connector) as session:
async with session.get('http://example.com') as response:
print(response.status)
async with session.get('http://xxx.local.') as response:
print(response.status)
asyncio.run(main())
API documentation
-----------------
The documentation is located at https://aiohttp-asyncmdnsresolver.readthedocs.io.
Source code
-----------
The project is hosted on GitHub_
Please file an issue on the `bug tracker
<https://github.com/aio-libs/aiohttp-asyncmdnsresolver/issues>`_ if you have found a bug
or have some suggestion in order to improve the library.
Authors and License
-------------------
It's *Apache 2* licensed and freely available.
.. _GitHub: https://github.com/aio-libs/aiohttp-asyncmdnsresolver
|