mongoose/docs/c-api/mg_dns.h/mg_set_protocol_dns.md
Dmitry Frank 3eb4eb8074 Fix mongoose docs generation
PUBLISHED_FROM=331821dcd1f7dc8a94581cd8a9b51aa00a89fddc
2018-02-03 01:20:48 +02:00

679 B

title decl_name symbol_kind signature
mg_set_protocol_dns() mg_set_protocol_dns func void mg_set_protocol_dns(struct mg_connection *nc);

Attaches a built-in DNS event handler to the given listening connection.

The DNS event handler parses the incoming UDP packets, treating them as DNS requests. If an incoming packet gets successfully parsed by the DNS event handler, a user event handler will receive an MG_DNS_REQUEST event, with ev_data pointing to the parsed struct mg_dns_message.

See captive_dns_server example on how to handle DNS request and send DNS reply.