mirror of
https://github.com/n0-computer/iroh.git
synced 2026-11-29 08:01:13 +00:00
12 lines
5.1 KiB
HTML
12 lines
5.1 KiB
HTML
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="A DNS server and pkarr relay."><title>iroh_dns_server - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="iroh_dns_server" data-themes="" data-resource-suffix="" data-rustdoc-version="1.92.0-nightly (b6f0945e4 2025-10-08)" data-channel="nightly" data-search-js="search-8d3311b9.js" data-stringdex-js="stringdex-828709d0.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="../crates.js"></script><script defer src="../static.files/main-ce535bd0.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc mod crate"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Crate iroh_dns_server</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../iroh_dns_server/index.html">iroh_<wbr>dns_<wbr>server</a><span class="version">1.5.0</span></h2></div><div class="sidebar-elems"><ul class="block"><li><a id="all-types" href="all.html">All Items</a></li></ul><section id="rustdoc-toc"><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#example" title="Example">Example</a></li></ul><h3><a href="#modules">Crate Items</a></h3><ul class="block"><li><a href="#modules" title="Modules">Modules</a></li><li><a href="#structs" title="Structs">Structs</a></li></ul></section><div id="rustdoc-modnav"></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><h1>Crate <span>iroh_<wbr>dns_<wbr>server</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/iroh_dns_server/lib.rs.html#1-340">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A DNS server and <a href="https://github.com/Nuhvi/pkarr/">pkarr</a> relay.</p>
|
|
<p><a href="struct.Server.html" title="struct iroh_dns_server::Server"><code>Server</code></a> combines a DNS server (UDP and TCP) with an HTTP/HTTPS server
|
|
into a single process. Clients publish self-signed DNS records as <a href="https://github.com/Nuhvi/pkarr/">pkarr</a>
|
|
signed packets at <code>PUT /pkarr</code>; the server persists them and answers DNS
|
|
queries for the published names, including DNS-over-HTTPS at <code>/dns-query</code>.</p>
|
|
<p>With the mainline fallback enabled, keys missing from the local store are
|
|
looked up on the BitTorrent mainline DHT.</p>
|
|
<h2 id="example"><a class="doc-anchor" href="#example">§</a>Example</h2>
|
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>iroh_dns_server::{Server, config::Config};
|
|
<span class="kw">let </span>config = Config::load(<span class="string">"config.toml"</span>).<span class="kw">await</span><span class="question-mark">?</span>;
|
|
<span class="kw">let </span>server = Server::bind(config).<span class="kw">await</span><span class="question-mark">?</span>;
|
|
server.join().<span class="kw">await</span><span class="question-mark">?</span>;</code></pre></div></div></details><h2 id="modules" class="section-header">Modules<a href="#modules" class="anchor">§</a></h2><dl class="item-table"><dt><a class="mod" href="config/index.html" title="mod iroh_dns_server::config">config</a></dt><dd>Configuration for the <a href="struct.Server.html" title="struct iroh_dns_server::Server"><code>Server</code></a>.</dd></dl><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.Metrics.html" title="struct iroh_dns_server::Metrics">Metrics</a></dt><dd>Counters exposed by iroh-dns-server.</dd><dt><a class="struct" href="struct.Server.html" title="struct iroh_dns_server::Server">Server</a></dt><dd>A running iroh-dns server.</dd></dl></section></div></main></body></html> |