DNS Server asyncio.start_server(dns_req, "0.0.0.0", 53) #14153
Unanswered
SL2021-Dev
asked this question in
Using MicroPython
Replies: 3 comments 1 reply
|
What about reading the fine manual, only a google search away ? Quoting from https://docs.micropython.org/en/latest/library/asyncio.html:
Besides that, what do you expect |
0 replies
|
I know where the manual is SA... |
1 reply
|
Hi |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I use asyncio.start_server(web_req, "0.0.0.0", 80) with no issues !
But trying to capture a DNS request with... asyncio.start_server(dns_req, "0.0.0.0", 53)
never fires... async def dns_req(reader, writer):
code...
`
import asyncio, network
ap = network.WLAN(network.AP_IF)
ap.active(True)
ap.config(essid='Serve', password='12345678', authmode=network.AUTH_WPA_WPA2_PSK)
async def dns_req(reader, writer):
request = await reader.readline()
print(f'Received request: {request}')
async def main():
asyncio.create_task(asyncio.start_server(dns_req, "0.0.0.0", 53))
loop = asyncio.get_event_loop()
loop.create_task(main())
loop.run_forever()
`
Can be due to UDP ???
All reactions