| Crates.io | dominion |
| lib.rs | dominion |
| version | 0.4.0 |
| created_at | 2022-07-23 08:20:43.722784+00 |
| updated_at | 2023-02-03 19:55:23.680017+00 |
| description | Build DNS clients and servers |
| homepage | |
| repository | https://github.com/lopukhov/dominion |
| max_upload_size | |
| id | 631324 |
| size | 7,768 |
A crate to implement DNS [Server]s and clients.
use dominion::{Server, ServerService, DnsPacket};
use std::net::SocketAddr;
struct Echo;
impl ServerService for Echo {
fn run<'a>(&self, _client: SocketAddr, question: DnsPacket<'a>) -> Option<DnsPacket<'a>> { Some(question) }
}
Server::default()
.bind("127.0.0.1:5353".parse().unwrap())
.unwrap()
.serve(Echo);