DNS Server asyncio.start_server(dns_req, "0.0.0.0", 53) #14153
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 |
Beta Was this translation helpful? Give feedback.
-
I know where the manual is SA... |
Beta Was this translation helpful? Give feedback.
-
Hi |
Beta Was this translation helpful? Give feedback.
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 ???
Beta Was this translation helpful? Give feedback.
All reactions