NLnetLabs / domain

A DNS library for Rust.
https://nlnetlabs.nl/projects/domain/about/
BSD 3-Clause "New" or "Revised" License
341 stars 57 forks source link

Add the net::server module. #274

Closed ximon18 closed 4 months ago

ximon18 commented 6 months ago

This PR adds a net::server module to domain that enables the creation of UDP and TCP DNS servers using base transport server, middelware and service building blocks.

For examples of the code in use see:

Various things could be improved even without review feedback:

This PR also introduces tokio-tracing for async friendly context aware logging, e.g. one can capture the dns message id high up in a call tree and have it automatically included in a log message from deep in the call tree which I think is potentially very useful.

This PR is also probably incompatible with --no-default-features as that would disable the std feature yet this PR currently uses std functionality.

However, I think it's a good moment to take a look at it as-is.