mirror of
https://github.com/n0-computer/iroh.git
synced 2026-12-01 08:01:45 +00:00
deploy: 77f2aa9def7ec0a70420fb93439eb2e9f64b358f
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
<!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="The default QUIC port used by the Relay server to accept QUIC connections for QUIC address discovery"><title>DEFAULT_RELAY_QUIC_PORT in iroh::defaults - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.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" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-dbdb5eec.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="iroh" data-themes="" data-resource-suffix="" data-rustdoc-version="1.85.0-nightly (d10a6823f 2024-11-29)" data-channel="nightly" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc constant"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../iroh/index.html">iroh</a><span class="version">0.30.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In iroh::<wbr>defaults</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../index.html">iroh</a>::<wbr><a href="index.html">defaults</a></span><h1>Constant <span class="constant">DEFAULT_RELAY_QUIC_PORT</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_relay/defaults.rs.html#12">Source</a> </span></div><pre class="rust item-decl"><code>pub const DEFAULT_RELAY_QUIC_PORT: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u16.html">u16</a> = 7842; // 7_842u16</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The default QUIC port used by the Relay server to accept QUIC connections
|
||||
<!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="The default QUIC port used by the Relay server to accept QUIC connections for QUIC address discovery"><title>DEFAULT_RELAY_QUIC_PORT in iroh::defaults - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.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" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-dbdb5eec.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="iroh" data-themes="" data-resource-suffix="" data-rustdoc-version="1.85.0-nightly (d10a6823f 2024-11-29)" data-channel="nightly" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc constant"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../iroh/index.html">iroh</a><span class="version">0.30.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In iroh::<wbr>defaults</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../index.html">iroh</a>::<wbr><a href="index.html">defaults</a></span><h1>Constant <span class="constant">DEFAULT_RELAY_QUIC_PORT</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"></span></div><pre class="rust item-decl"><code>pub const DEFAULT_RELAY_QUIC_PORT: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u16.html">u16</a> = 7842; // 7_842u16</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The default QUIC port used by the Relay server to accept QUIC connections
|
||||
for QUIC address discovery</p>
|
||||
<p>The port is “QUIC” typed on a phone keypad.
|
||||
The default QUIC port used by the Relay server to accept QUIC connections
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<!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="The default STUN port used by the Relay server."><title>DEFAULT_STUN_PORT in iroh::defaults - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.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" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-dbdb5eec.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="iroh" data-themes="" data-resource-suffix="" data-rustdoc-version="1.85.0-nightly (d10a6823f 2024-11-29)" data-channel="nightly" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc constant"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../iroh/index.html">iroh</a><span class="version">0.30.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In iroh::<wbr>defaults</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../index.html">iroh</a>::<wbr><a href="index.html">defaults</a></span><h1>Constant <span class="constant">DEFAULT_STUN_PORT</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_relay/defaults.rs.html#6">Source</a> </span></div><pre class="rust item-decl"><code>pub const DEFAULT_STUN_PORT: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u16.html">u16</a> = 3478; // 3_478u16</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The default STUN port used by the Relay server.</p>
|
||||
<!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="The default STUN port used by the Relay server."><title>DEFAULT_STUN_PORT in iroh::defaults - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.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" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-dbdb5eec.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="iroh" data-themes="" data-resource-suffix="" data-rustdoc-version="1.85.0-nightly (d10a6823f 2024-11-29)" data-channel="nightly" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc constant"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../iroh/index.html">iroh</a><span class="version">0.30.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In iroh::<wbr>defaults</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../index.html">iroh</a>::<wbr><a href="index.html">defaults</a></span><h1>Constant <span class="constant">DEFAULT_STUN_PORT</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"></span></div><pre class="rust item-decl"><code>pub const DEFAULT_STUN_PORT: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u16.html">u16</a> = 3478; // 3_478u16</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The default STUN port used by the Relay server.</p>
|
||||
<p>The STUN port as defined by <a href="https://www.rfc-editor.org/rfc/rfc8489#section-18.6">RFC
|
||||
8489</a>
|
||||
The default STUN port used by the Relay server.</p>
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,4 +1,4 @@
|
||||
<!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="Runs a relay server with STUN and QUIC enabled suitable for tests."><title>run_relay_server in iroh::test_utils - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.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" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-dbdb5eec.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="iroh" data-themes="" data-resource-suffix="" data-rustdoc-version="1.85.0-nightly (d10a6823f 2024-11-29)" data-channel="nightly" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../iroh/index.html">iroh</a><span class="version">0.30.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In iroh::<wbr>test_<wbr>utils</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../index.html">iroh</a>::<wbr><a href="index.html">test_utils</a></span><h1>Function <span class="fn">run_relay_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/test_utils.rs.html#30-38">Source</a> </span></div><pre class="rust item-decl"><code>pub async fn run_relay_server() -> <a class="type" href="https://docs.rs/anyhow/1.0.94/anyhow/type.Result.html" title="type anyhow::Result">Result</a><(<a class="struct" href="../struct.RelayMap.html" title="struct iroh::RelayMap">RelayMap</a>, <a class="struct" href="../struct.RelayUrl.html" title="struct iroh::RelayUrl">RelayUrl</a>, <a class="struct" href="../../iroh_relay/server/struct.Server.html" title="struct iroh_relay::server::Server">Server</a>)></code></pre><span class="item-info"><div class="stab portability">Available on <strong>crate feature <code>test-utils</code></strong> only.</div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Runs a relay server with STUN and QUIC enabled suitable for tests.</p>
|
||||
<!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="Runs a relay server with STUN and QUIC enabled suitable for tests."><title>run_relay_server in iroh::test_utils - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.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" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-dbdb5eec.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="iroh" data-themes="" data-resource-suffix="" data-rustdoc-version="1.85.0-nightly (d10a6823f 2024-11-29)" data-channel="nightly" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../iroh/index.html">iroh</a><span class="version">0.30.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In iroh::<wbr>test_<wbr>utils</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../index.html">iroh</a>::<wbr><a href="index.html">test_utils</a></span><h1>Function <span class="fn">run_relay_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/test_utils.rs.html#30-38">Source</a> </span></div><pre class="rust item-decl"><code>pub async fn run_relay_server() -> <a class="type" href="https://docs.rs/anyhow/1.0.94/anyhow/type.Result.html" title="type anyhow::Result">Result</a><(<a class="struct" href="../struct.RelayMap.html" title="struct iroh::RelayMap">RelayMap</a>, <a class="struct" href="../struct.RelayUrl.html" title="struct iroh::RelayUrl">RelayUrl</a>, Server)></code></pre><span class="item-info"><div class="stab portability">Available on <strong>crate feature <code>test-utils</code></strong> only.</div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Runs a relay server with STUN and QUIC enabled suitable for tests.</p>
|
||||
<p>The returned <code>Url</code> is the url of the relay server in the returned <a href="../struct.RelayMap.html" title="struct iroh::RelayMap"><code>RelayMap</code></a>.
|
||||
When dropped, the returned <a href="../../iroh_relay/server/struct.Server.html" title="struct iroh_relay::server::Server"><code>Server</code></a> does will stop running.</p>
|
||||
When dropped, the returned [<code>Server</code>] does will stop running.</p>
|
||||
</div></details></section></div></main></body></html>
|
||||
@@ -1,9 +1,9 @@
|
||||
<!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="Runs a relay server."><title>run_relay_server_with in iroh::test_utils - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.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" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-dbdb5eec.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="iroh" data-themes="" data-resource-suffix="" data-rustdoc-version="1.85.0-nightly (d10a6823f 2024-11-29)" data-channel="nightly" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../iroh/index.html">iroh</a><span class="version">0.30.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In iroh::<wbr>test_<wbr>utils</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../index.html">iroh</a>::<wbr><a href="index.html">test_utils</a></span><h1>Function <span class="fn">run_relay_server_with</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/test_utils.rs.html#63-107">Source</a> </span></div><pre class="rust item-decl"><code>pub async fn run_relay_server_with(
|
||||
stun: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../iroh_relay/server/struct.StunConfig.html" title="struct iroh_relay::server::StunConfig">StunConfig</a>>,
|
||||
stun: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><StunConfig>,
|
||||
quic: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>,
|
||||
) -> <a class="type" href="https://docs.rs/anyhow/1.0.94/anyhow/type.Result.html" title="type anyhow::Result">Result</a><(<a class="struct" href="../struct.RelayMap.html" title="struct iroh::RelayMap">RelayMap</a>, <a class="struct" href="../struct.RelayUrl.html" title="struct iroh::RelayUrl">RelayUrl</a>, <a class="struct" href="../../iroh_relay/server/struct.Server.html" title="struct iroh_relay::server::Server">Server</a>)></code></pre><span class="item-info"><div class="stab portability">Available on <strong>crate feature <code>test-utils</code></strong> only.</div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Runs a relay server.</p>
|
||||
) -> <a class="type" href="https://docs.rs/anyhow/1.0.94/anyhow/type.Result.html" title="type anyhow::Result">Result</a><(<a class="struct" href="../struct.RelayMap.html" title="struct iroh::RelayMap">RelayMap</a>, <a class="struct" href="../struct.RelayUrl.html" title="struct iroh::RelayUrl">RelayUrl</a>, Server)></code></pre><span class="item-info"><div class="stab portability">Available on <strong>crate feature <code>test-utils</code></strong> only.</div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Runs a relay server.</p>
|
||||
<p><code>stun</code> can be set to <code>None</code> to disable stun, or set to <code>Some</code> <code>StunConfig</code>,
|
||||
to enable stun on a specific socket.</p>
|
||||
<p>If <code>quic</code> is set to <code>true</code>, it will make the appropriate <a href="../../iroh_relay/server/struct.QuicConfig.html" title="struct iroh_relay::server::QuicConfig"><code>QuicConfig</code></a> from the generated tls certificates and run the quic server at a random free port.</p>
|
||||
<p>If <code>quic</code> is set to <code>true</code>, it will make the appropriate [<code>QuicConfig</code>] from the generated tls certificates and run the quic server at a random free port.</p>
|
||||
<p>The return value is similar to <a href="fn.run_relay_server.html" title="fn iroh::test_utils::run_relay_server"><code>run_relay_server</code></a>.</p>
|
||||
</div></details></section></div></main></body></html>
|
||||
@@ -1,4 +1,4 @@
|
||||
<!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="Runs a relay server with STUN enabled suitable for tests."><title>run_relay_server_with_stun in iroh::test_utils - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.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" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-dbdb5eec.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="iroh" data-themes="" data-resource-suffix="" data-rustdoc-version="1.85.0-nightly (d10a6823f 2024-11-29)" data-channel="nightly" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../iroh/index.html">iroh</a><span class="version">0.30.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In iroh::<wbr>test_<wbr>utils</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../index.html">iroh</a>::<wbr><a href="index.html">test_utils</a></span><h1>Function <span class="fn">run_relay_server_with_stun</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/test_utils.rs.html#44-52">Source</a> </span></div><pre class="rust item-decl"><code>pub async fn run_relay_server_with_stun() -> <a class="type" href="https://docs.rs/anyhow/1.0.94/anyhow/type.Result.html" title="type anyhow::Result">Result</a><(<a class="struct" href="../struct.RelayMap.html" title="struct iroh::RelayMap">RelayMap</a>, <a class="struct" href="../struct.RelayUrl.html" title="struct iroh::RelayUrl">RelayUrl</a>, <a class="struct" href="../../iroh_relay/server/struct.Server.html" title="struct iroh_relay::server::Server">Server</a>)></code></pre><span class="item-info"><div class="stab portability">Available on <strong>crate feature <code>test-utils</code></strong> only.</div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Runs a relay server with STUN enabled suitable for tests.</p>
|
||||
<!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="Runs a relay server with STUN enabled suitable for tests."><title>run_relay_server_with_stun in iroh::test_utils - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.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" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-dbdb5eec.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="iroh" data-themes="" data-resource-suffix="" data-rustdoc-version="1.85.0-nightly (d10a6823f 2024-11-29)" data-channel="nightly" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../iroh/index.html">iroh</a><span class="version">0.30.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In iroh::<wbr>test_<wbr>utils</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../index.html">iroh</a>::<wbr><a href="index.html">test_utils</a></span><h1>Function <span class="fn">run_relay_server_with_stun</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/test_utils.rs.html#44-52">Source</a> </span></div><pre class="rust item-decl"><code>pub async fn run_relay_server_with_stun() -> <a class="type" href="https://docs.rs/anyhow/1.0.94/anyhow/type.Result.html" title="type anyhow::Result">Result</a><(<a class="struct" href="../struct.RelayMap.html" title="struct iroh::RelayMap">RelayMap</a>, <a class="struct" href="../struct.RelayUrl.html" title="struct iroh::RelayUrl">RelayUrl</a>, Server)></code></pre><span class="item-info"><div class="stab portability">Available on <strong>crate feature <code>test-utils</code></strong> only.</div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Runs a relay server with STUN enabled suitable for tests.</p>
|
||||
<p>The returned <code>Url</code> is the url of the relay server in the returned <a href="../struct.RelayMap.html" title="struct iroh::RelayMap"><code>RelayMap</code></a>.
|
||||
When dropped, the returned <a href="../../iroh_relay/server/struct.Server.html" title="struct iroh_relay::server::Server"><code>Server</code></a> does will stop running.</p>
|
||||
When dropped, the returned [<code>Server</code>] does will stop running.</p>
|
||||
</div></details></section></div></main></body></html>
|
||||
@@ -16,7 +16,7 @@ stop running.</p>
|
||||
allows sending messages to the actor.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.get_report" class="method"><a class="src rightside" href="../src/iroh_net_report/lib.rs.html#394-410">Source</a><h4 class="code-header">pub async fn <a href="#method.get_report" class="fn">get_report</a>(
|
||||
&mut self,
|
||||
relay_map: <a class="struct" href="../iroh_relay/relay_map/struct.RelayMap.html" title="struct iroh_relay::relay_map::RelayMap">RelayMap</a>,
|
||||
relay_map: RelayMap,
|
||||
stun_sock_v4: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><UdpSocket>>,
|
||||
stun_sock_v6: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><UdpSocket>>,
|
||||
quic_config: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="struct.QuicConfig.html" title="struct iroh_net_report::QuicConfig">QuicConfig</a>>,
|
||||
@@ -38,14 +38,14 @@ using QUIC address discovery.</p>
|
||||
<p>This will attempt to use <em>all</em> probe protocols.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.get_report_with_opts" class="method"><a class="src rightside" href="../src/iroh_net_report/lib.rs.html#417-427">Source</a><h4 class="code-header">pub async fn <a href="#method.get_report_with_opts" class="fn">get_report_with_opts</a>(
|
||||
&mut self,
|
||||
relay_map: <a class="struct" href="../iroh_relay/relay_map/struct.RelayMap.html" title="struct iroh_relay::relay_map::RelayMap">RelayMap</a>,
|
||||
relay_map: RelayMap,
|
||||
opts: <a class="struct" href="struct.Options.html" title="struct iroh_net_report::Options">Options</a>,
|
||||
) -> <a class="type" href="https://docs.rs/anyhow/1.0.94/anyhow/type.Result.html" title="type anyhow::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="struct.Report.html" title="struct iroh_net_report::Report">Report</a>>></h4></section></summary><div class="docblock"><p>Runs a net_report, returning the report.</p>
|
||||
<p>It may not be called concurrently with itself, <code>&mut self</code> takes care of that.</p>
|
||||
<p>Look at <a href="struct.Options.html" title="struct iroh_net_report::Options"><code>Options</code></a> for the different configuration options.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.get_report_channel" class="method"><a class="src rightside" href="../src/iroh_net_report/lib.rs.html#432-446">Source</a><h4 class="code-header">pub async fn <a href="#method.get_report_channel" class="fn">get_report_channel</a>(
|
||||
&mut self,
|
||||
relay_map: <a class="struct" href="../iroh_relay/relay_map/struct.RelayMap.html" title="struct iroh_relay::relay_map::RelayMap">RelayMap</a>,
|
||||
relay_map: RelayMap,
|
||||
opts: <a class="struct" href="struct.Options.html" title="struct iroh_net_report::Options">Options</a>,
|
||||
) -> <a class="type" href="https://docs.rs/anyhow/1.0.94/anyhow/type.Result.html" title="type anyhow::Result">Result</a><Receiver<<a class="type" href="https://docs.rs/anyhow/1.0.94/anyhow/type.Result.html" title="type anyhow::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="struct.Report.html" title="struct iroh_net_report::Report">Report</a>>>>></h4></section></summary><div class="docblock"><p>Get report with channel</p>
|
||||
<p>Look at <a href="struct.Options.html" title="struct iroh_net_report::Options"><code>Options</code></a> for the different configuration options.</p>
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -11,7 +11,7 @@
|
||||
pub mapping_varies_by_dest_ipv6: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>>,
|
||||
pub hair_pinning: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>>,
|
||||
pub portmap_probe: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><ProbeOutput>,
|
||||
pub preferred_relay: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../iroh_base/relay_url/struct.RelayUrl.html" title="struct iroh_base::relay_url::RelayUrl">RelayUrl</a>>,
|
||||
pub preferred_relay: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><RelayUrl>,
|
||||
pub relay_latency: <a class="struct" href="struct.RelayLatencies.html" title="struct iroh_net_report::RelayLatencies">RelayLatencies</a>,
|
||||
pub relay_v4_latency: <a class="struct" href="struct.RelayLatencies.html" title="struct iroh_net_report::RelayLatencies">RelayLatencies</a>,
|
||||
pub relay_v6_latency: <a class="struct" href="struct.RelayLatencies.html" title="struct iroh_net_report::RelayLatencies">RelayLatencies</a>,
|
||||
@@ -35,7 +35,7 @@ detecting rather than using it. For now.</p>
|
||||
</div><span id="structfield.hair_pinning" class="structfield section-header"><a href="#structfield.hair_pinning" class="anchor field">§</a><code>hair_pinning: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>></code></span><div class="docblock"><p>Whether the router supports communicating between two local devices through the NATted
|
||||
public IP address (on IPv4).</p>
|
||||
</div><span id="structfield.portmap_probe" class="structfield section-header"><a href="#structfield.portmap_probe" class="anchor field">§</a><code>portmap_probe: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><ProbeOutput></code></span><div class="docblock"><p>Probe indicating the presence of port mapping protocols on the LAN.</p>
|
||||
</div><span id="structfield.preferred_relay" class="structfield section-header"><a href="#structfield.preferred_relay" class="anchor field">§</a><code>preferred_relay: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../iroh_base/relay_url/struct.RelayUrl.html" title="struct iroh_base::relay_url::RelayUrl">RelayUrl</a>></code></span><div class="docblock"><p><code>None</code> for unknown</p>
|
||||
</div><span id="structfield.preferred_relay" class="structfield section-header"><a href="#structfield.preferred_relay" class="anchor field">§</a><code>preferred_relay: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><RelayUrl></code></span><div class="docblock"><p><code>None</code> for unknown</p>
|
||||
</div><span id="structfield.relay_latency" class="structfield section-header"><a href="#structfield.relay_latency" class="anchor field">§</a><code>relay_latency: <a class="struct" href="struct.RelayLatencies.html" title="struct iroh_net_report::RelayLatencies">RelayLatencies</a></code></span><div class="docblock"><p>keyed by relay Url</p>
|
||||
</div><span id="structfield.relay_v4_latency" class="structfield section-header"><a href="#structfield.relay_v4_latency" class="anchor field">§</a><code>relay_v4_latency: <a class="struct" href="struct.RelayLatencies.html" title="struct iroh_net_report::RelayLatencies">RelayLatencies</a></code></span><div class="docblock"><p>keyed by relay Url</p>
|
||||
</div><span id="structfield.relay_v6_latency" class="structfield section-header"><a href="#structfield.relay_v6_latency" class="anchor field">§</a><code>relay_v6_latency: <a class="struct" href="struct.RelayLatencies.html" title="struct iroh_net_report::RelayLatencies">RelayLatencies</a></code></span><div class="docblock"><p>keyed by relay Url</p>
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../../iroh_relay/client/enum.ConnSendError.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../../iroh_relay/client/enum.ConnSendError.html">../../../iroh_relay/client/enum.ConnSendError.html</a>...</p>
|
||||
<script>location.replace("../../../iroh_relay/client/enum.ConnSendError.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../../iroh_relay/client/enum.SendMessage.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../../iroh_relay/client/enum.SendMessage.html">../../../iroh_relay/client/enum.SendMessage.html</a>...</p>
|
||||
<script>location.replace("../../../iroh_relay/client/enum.SendMessage.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,3 +1,3 @@
|
||||
<!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="Creates a client config that trusts any servers without verifying their TLS certificate."><title>make_dangerous_client_config in iroh_relay::client - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.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" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-dbdb5eec.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="iroh_relay" data-themes="" data-resource-suffix="" data-rustdoc-version="1.85.0-nightly (d10a6823f 2024-11-29)" data-channel="nightly" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../iroh_relay/index.html">iroh_<wbr>relay</a><span class="version">0.30.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In iroh_<wbr>relay::<wbr>client</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../index.html">iroh_relay</a>::<wbr><a href="index.html">client</a></span><h1>Function <span class="fn">make_dangerous_client_config</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_relay/client.rs.html#286-298">Source</a> </span></div><pre class="rust item-decl"><code>pub fn make_dangerous_client_config() -> ClientConfig</code></pre><span class="item-info"><div class="stab portability">Available on <strong>crate feature <code>test-utils</code></strong> only.</div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Creates a client config that trusts any servers without verifying their TLS certificate.</p>
|
||||
<!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="Creates a client config that trusts any servers without verifying their TLS certificate."><title>make_dangerous_client_config in iroh_relay::client - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.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" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-dbdb5eec.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="iroh_relay" data-themes="" data-resource-suffix="" data-rustdoc-version="1.85.0-nightly (d10a6823f 2024-11-29)" data-channel="nightly" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../iroh_relay/index.html">iroh_<wbr>relay</a><span class="version">0.30.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In iroh_<wbr>relay::<wbr>client</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../index.html">iroh_relay</a>::<wbr><a href="index.html">client</a></span><h1>Function <span class="fn">make_dangerous_client_config</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_relay/client.rs.html#303-315">Source</a> </span></div><pre class="rust item-decl"><code>pub fn make_dangerous_client_config() -> ClientConfig</code></pre><span class="item-info"><div class="stab portability">Available on <strong>crate feature <code>test-utils</code></strong> only.</div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Creates a client config that trusts any servers without verifying their TLS certificate.</p>
|
||||
<p>Should be used for testing local relay setups only.</p>
|
||||
</div></details></section></div></main></body></html>
|
||||
@@ -1,3 +1,3 @@
|
||||
<!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="Exposes `Client`, which allows to establish connections to a relay server."><title>iroh_relay::client - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.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" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-dbdb5eec.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="iroh_relay" data-themes="" data-resource-suffix="" data-rustdoc-version="1.85.0-nightly (d10a6823f 2024-11-29)" data-channel="nightly" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../../static.files/storage-59e33391.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../iroh_relay/index.html">iroh_<wbr>relay</a><span class="version">0.30.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module client</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#enums" title="Enums">Enums</a></li><li><a href="#functions" title="Functions">Functions</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="../index.html">In crate iroh_<wbr>relay</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../index.html">iroh_relay</a></span><h1>Module <span>client</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_relay/client.rs.html#1-941">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Exposes <a href="struct.Client.html" title="struct iroh_relay::client::Client"><code>Client</code></a>, which allows to establish connections to a relay server.</p>
|
||||
<!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="Exposes `Client`, which allows to establish connections to a relay server."><title>iroh_relay::client - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.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" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-dbdb5eec.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="iroh_relay" data-themes="" data-resource-suffix="" data-rustdoc-version="1.85.0-nightly (d10a6823f 2024-11-29)" data-channel="nightly" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../../static.files/storage-59e33391.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../iroh_relay/index.html">iroh_<wbr>relay</a><span class="version">0.30.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module client</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#enums" title="Enums">Enums</a></li><li><a href="#functions" title="Functions">Functions</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="../index.html">In crate iroh_<wbr>relay</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../index.html">iroh_relay</a></span><h1>Module <span>client</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_relay/client.rs.html#1-755">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Exposes <a href="struct.Client.html" title="struct iroh_relay::client::Client"><code>Client</code></a>, which allows to establish connections to a relay server.</p>
|
||||
<p>Based on tailscale/derp/derphttp/derphttp_client.go</p>
|
||||
</div></details><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="struct" href="struct.Client.html" title="struct iroh_relay::client::Client">Client</a></div><div class="desc docblock-short">An HTTP Relay client.</div></li><li><div class="item-name"><a class="struct" href="struct.ClientBuilder.html" title="struct iroh_relay::client::ClientBuilder">Client<wbr>Builder</a></div><div class="desc docblock-short">Build a Client.</div></li></ul><h2 id="enums" class="section-header">Enums<a href="#enums" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="enum" href="enum.ClientError.html" title="enum iroh_relay::client::ClientError">Client<wbr>Error</a></div><div class="desc docblock-short">Possible connection errors on the <a href="struct.Client.html" title="struct iroh_relay::client::Client"><code>Client</code></a></div></li><li><div class="item-name"><a class="enum" href="enum.ReceivedMessage.html" title="enum iroh_relay::client::ReceivedMessage">Received<wbr>Message</a></div><div class="desc docblock-short">The messages received from a framed relay stream.</div></li></ul><h2 id="functions" class="section-header">Functions<a href="#functions" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="fn" href="fn.make_dangerous_client_config.html" title="fn iroh_relay::client::make_dangerous_client_config">make_<wbr>dangerous_<wbr>client_<wbr>config</a><wbr><span class="stab portability" title="Available on crate feature `test-utils` only"><code>test-utils</code></span></div><div class="desc docblock-short">Creates a client config that trusts any servers without verifying their TLS certificate.</div></li></ul></section></div></main></body></html>
|
||||
</div></details><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="struct" href="struct.Client.html" title="struct iroh_relay::client::Client">Client</a></div><div class="desc docblock-short">A relay client.</div></li><li><div class="item-name"><a class="struct" href="struct.ClientBuilder.html" title="struct iroh_relay::client::ClientBuilder">Client<wbr>Builder</a></div><div class="desc docblock-short">Build a Client.</div></li><li><div class="item-name"><a class="struct" href="struct.ClientSink.html" title="struct iroh_relay::client::ClientSink">Client<wbr>Sink</a></div><div class="desc docblock-short">The send half of a relay client.</div></li><li><div class="item-name"><a class="struct" href="struct.ClientStream.html" title="struct iroh_relay::client::ClientStream">Client<wbr>Stream</a></div><div class="desc docblock-short">The receive half of a relay client.</div></li></ul><h2 id="enums" class="section-header">Enums<a href="#enums" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="enum" href="enum.ConnSendError.html" title="enum iroh_relay::client::ConnSendError">Conn<wbr>Send<wbr>Error</a></div><div class="desc docblock-short">Error for sending messages to the relay server.</div></li><li><div class="item-name"><a class="enum" href="enum.ReceivedMessage.html" title="enum iroh_relay::client::ReceivedMessage">Received<wbr>Message</a></div><div class="desc docblock-short">The messages received from a framed relay stream.</div></li><li><div class="item-name"><a class="enum" href="enum.SendMessage.html" title="enum iroh_relay::client::SendMessage">Send<wbr>Message</a></div><div class="desc docblock-short">Messages we can send to a relay server.</div></li></ul><h2 id="functions" class="section-header">Functions<a href="#functions" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="fn" href="fn.make_dangerous_client_config.html" title="fn iroh_relay::client::make_dangerous_client_config">make_<wbr>dangerous_<wbr>client_<wbr>config</a><wbr><span class="stab portability" title="Available on crate feature `test-utils` only"><code>test-utils</code></span></div><div class="desc docblock-short">Creates a client config that trusts any servers without verifying their TLS certificate.</div></li></ul></section></div></main></body></html>
|
||||
@@ -1 +1 @@
|
||||
window.SIDEBAR_ITEMS = {"enum":["ClientError","ReceivedMessage"],"fn":["make_dangerous_client_config"],"struct":["Client","ClientBuilder"]};
|
||||
window.SIDEBAR_ITEMS = {"enum":["ConnSendError","ReceivedMessage","SendMessage"],"fn":["make_dangerous_client_config"],"struct":["Client","ClientBuilder","ClientSink","ClientStream"]};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,3 +1,3 @@
|
||||
<!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="Default values used in the relay."><title>iroh_relay::defaults - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.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" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-dbdb5eec.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="iroh_relay" data-themes="" data-resource-suffix="" data-rustdoc-version="1.85.0-nightly (d10a6823f 2024-11-29)" data-channel="nightly" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../../static.files/storage-59e33391.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../iroh_relay/index.html">iroh_<wbr>relay</a><span class="version">0.30.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module defaults</a></h2><h3><a href="#constants">Module Items</a></h3><ul class="block"><li><a href="#constants" title="Constants">Constants</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="../index.html">In crate iroh_<wbr>relay</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../index.html">iroh_relay</a></span><h1>Module <span>defaults</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_relay/defaults.rs.html#1-53">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Default values used in the relay.</p>
|
||||
<!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="Default values used in the relay."><title>iroh_relay::defaults - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.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" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-dbdb5eec.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="iroh_relay" data-themes="" data-resource-suffix="" data-rustdoc-version="1.85.0-nightly (d10a6823f 2024-11-29)" data-channel="nightly" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../../static.files/storage-59e33391.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../iroh_relay/index.html">iroh_<wbr>relay</a><span class="version">0.30.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module defaults</a></h2><h3><a href="#constants">Module Items</a></h3><ul class="block"><li><a href="#constants" title="Constants">Constants</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="../index.html">In crate iroh_<wbr>relay</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../index.html">iroh_relay</a></span><h1>Module <span>defaults</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_relay/defaults.rs.html#1-43">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Default values used in the relay.</p>
|
||||
</div></details><h2 id="constants" class="section-header">Constants<a href="#constants" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="constant" href="constant.DEFAULT_HTTPS_PORT.html" title="constant iroh_relay::defaults::DEFAULT_HTTPS_PORT">DEFAULT_<wbr>HTTPS_<wbr>PORT</a></div><div class="desc docblock-short">The default HTTPS port used by the Relay server.</div></li><li><div class="item-name"><a class="constant" href="constant.DEFAULT_HTTP_PORT.html" title="constant iroh_relay::defaults::DEFAULT_HTTP_PORT">DEFAULT_<wbr>HTTP_<wbr>PORT</a></div><div class="desc docblock-short">The default HTTP port used by the Relay server.</div></li><li><div class="item-name"><a class="constant" href="constant.DEFAULT_KEY_CACHE_CAPACITY.html" title="constant iroh_relay::defaults::DEFAULT_KEY_CACHE_CAPACITY">DEFAULT_<wbr>KEY_<wbr>CACHE_<wbr>CAPACITY</a></div><div class="desc docblock-short">The default capacity of the key cache for the relay server.</div></li><li><div class="item-name"><a class="constant" href="constant.DEFAULT_METRICS_PORT.html" title="constant iroh_relay::defaults::DEFAULT_METRICS_PORT">DEFAULT_<wbr>METRICS_<wbr>PORT</a></div><div class="desc docblock-short">The default metrics port used by the Relay server.</div></li><li><div class="item-name"><a class="constant" href="constant.DEFAULT_RELAY_QUIC_PORT.html" title="constant iroh_relay::defaults::DEFAULT_RELAY_QUIC_PORT">DEFAULT_<wbr>RELAY_<wbr>QUIC_<wbr>PORT</a></div><div class="desc docblock-short">The default QUIC port used by the Relay server to accept QUIC connections
|
||||
for QUIC address discovery</div></li><li><div class="item-name"><a class="constant" href="constant.DEFAULT_STUN_PORT.html" title="constant iroh_relay::defaults::DEFAULT_STUN_PORT">DEFAULT_<wbr>STUN_<wbr>PORT</a></div><div class="desc docblock-short">The default STUN port used by the Relay server.</div></li></ul></section></div></main></body></html>
|
||||
@@ -1,4 +1,4 @@
|
||||
<!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="The maximum size of a packet sent over relay. (This only includes the data bytes visible to magicsock, not including its on-wire framing overhead)"><title>MAX_PACKET_SIZE in iroh_relay::protos::relay - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.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" crossorigin href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../static.files/rustdoc-dbdb5eec.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="iroh_relay" data-themes="" data-resource-suffix="" data-rustdoc-version="1.85.0-nightly (d10a6823f 2024-11-29)" data-channel="nightly" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../../../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-044be391.svg"></head><body class="rustdoc constant"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../iroh_relay/index.html">iroh_<wbr>relay</a><span class="version">0.30.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In iroh_<wbr>relay::<wbr>protos::<wbr>relay</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../../index.html">iroh_relay</a>::<wbr><a href="../index.html">protos</a>::<wbr><a href="index.html">relay</a></span><h1>Constant <span class="constant">MAX_PACKET_SIZE</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_relay/protos/relay.rs.html#33">Source</a> </span></div><pre class="rust item-decl"><code>pub const MAX_PACKET_SIZE: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a> = _; // 65_536usize</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The maximum size of a packet sent over relay.
|
||||
<!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="The maximum size of a packet sent over relay. (This only includes the data bytes visible to magicsock, not including its on-wire framing overhead)"><title>MAX_PACKET_SIZE in iroh_relay::protos::relay - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.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" crossorigin href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../static.files/rustdoc-dbdb5eec.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="iroh_relay" data-themes="" data-resource-suffix="" data-rustdoc-version="1.85.0-nightly (d10a6823f 2024-11-29)" data-channel="nightly" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../../../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-044be391.svg"></head><body class="rustdoc constant"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../iroh_relay/index.html">iroh_<wbr>relay</a><span class="version">0.30.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In iroh_<wbr>relay::<wbr>protos::<wbr>relay</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../../index.html">iroh_relay</a>::<wbr><a href="../index.html">protos</a>::<wbr><a href="index.html">relay</a></span><h1>Constant <span class="constant">MAX_PACKET_SIZE</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_relay/protos/relay.rs.html#34">Source</a> </span></div><pre class="rust item-decl"><code>pub const MAX_PACKET_SIZE: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a> = _; // 65_536usize</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The maximum size of a packet sent over relay.
|
||||
(This only includes the data bytes visible to magicsock, not
|
||||
including its on-wire framing overhead)</p>
|
||||
</div></details></section></div></main></body></html>
|
||||
@@ -1,4 +1,4 @@
|
||||
<!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="This module implements the relaying protocol used by the `server` and `client`."><title>iroh_relay::protos::relay - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.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" crossorigin href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../static.files/rustdoc-dbdb5eec.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="iroh_relay" data-themes="" data-resource-suffix="" data-rustdoc-version="1.85.0-nightly (d10a6823f 2024-11-29)" data-channel="nightly" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../../../static.files/storage-59e33391.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../iroh_relay/index.html">iroh_<wbr>relay</a><span class="version">0.30.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module relay</a></h2><h3><a href="#constants">Module Items</a></h3><ul class="block"><li><a href="#constants" title="Constants">Constants</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In iroh_<wbr>relay::<wbr>protos</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../../index.html">iroh_relay</a>::<wbr><a href="../index.html">protos</a></span><h1>Module <span>relay</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_relay/protos/relay.rs.html#1-841">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>This module implements the relaying protocol used by the <code>server</code> and <code>client</code>.</p>
|
||||
<!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="This module implements the relaying protocol used by the `server` and `client`."><title>iroh_relay::protos::relay - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.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" crossorigin href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../static.files/rustdoc-dbdb5eec.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="iroh_relay" data-themes="" data-resource-suffix="" data-rustdoc-version="1.85.0-nightly (d10a6823f 2024-11-29)" data-channel="nightly" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../../../static.files/storage-59e33391.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../iroh_relay/index.html">iroh_<wbr>relay</a><span class="version">0.30.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module relay</a></h2><h3><a href="#constants">Module Items</a></h3><ul class="block"><li><a href="#constants" title="Constants">Constants</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In iroh_<wbr>relay::<wbr>protos</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../../index.html">iroh_relay</a>::<wbr><a href="../index.html">protos</a></span><h1>Module <span>relay</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_relay/protos/relay.rs.html#1-844">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>This module implements the relaying protocol used by the <code>server</code> and <code>client</code>.</p>
|
||||
<p>Protocol flow:</p>
|
||||
<p>Login:</p>
|
||||
<ul>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<!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 fully-fledged iroh-relay server over HTTP or HTTPS."><title>iroh_relay::server - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.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" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-dbdb5eec.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="iroh_relay" data-themes="" data-resource-suffix="" data-rustdoc-version="1.85.0-nightly (d10a6823f 2024-11-29)" data-channel="nightly" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../../static.files/storage-59e33391.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../iroh_relay/index.html">iroh_<wbr>relay</a><span class="version">0.30.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module server</a></h2><h3><a href="#modules">Module Items</a></h3><ul class="block"><li><a href="#modules" title="Modules">Modules</a></li><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#enums" title="Enums">Enums</a></li><li><a href="#constants" title="Constants">Constants</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="../index.html">In crate iroh_<wbr>relay</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../index.html">iroh_relay</a></span><h1>Module <span>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_relay/server.rs.html#1-1116">Source</a> </span></div><span class="item-info"><div class="stab portability">Available on <strong>crate feature <code>server</code></strong> only.</div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A fully-fledged iroh-relay server over HTTP or HTTPS.</p>
|
||||
<!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 fully-fledged iroh-relay server over HTTP or HTTPS."><title>iroh_relay::server - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.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" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-dbdb5eec.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="iroh_relay" data-themes="" data-resource-suffix="" data-rustdoc-version="1.85.0-nightly (d10a6823f 2024-11-29)" data-channel="nightly" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../../static.files/storage-59e33391.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../iroh_relay/index.html">iroh_<wbr>relay</a><span class="version">0.30.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module server</a></h2><h3><a href="#modules">Module Items</a></h3><ul class="block"><li><a href="#modules" title="Modules">Modules</a></li><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#enums" title="Enums">Enums</a></li><li><a href="#constants" title="Constants">Constants</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="../index.html">In crate iroh_<wbr>relay</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../index.html">iroh_relay</a></span><h1>Module <span>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_relay/server.rs.html#1-1110">Source</a> </span></div><span class="item-info"><div class="stab portability">Available on <strong>crate feature <code>server</code></strong> only.</div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A fully-fledged iroh-relay server over HTTP or HTTPS.</p>
|
||||
<p>This module provides an API to run a full fledged iroh-relay server. It is primarily
|
||||
used by the <code>iroh-relay</code> binary in this crate. It can be used to run a relay server in
|
||||
other locations however.</p>
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -3518,8 +3518,8 @@
|
||||
<span class="kw">let </span>eps = ep.bound_sockets();
|
||||
<span class="macro">info!</span>(me = %ep.node_id().fmt_short(), ipv4=%eps.<span class="number">0</span>, ipv6=<span class="question-mark">?</span>eps.<span class="number">1</span>, <span class="string">"server listening on"</span>);
|
||||
<span class="kw">for </span>i <span class="kw">in </span><span class="number">0</span>..n_clients {
|
||||
<span class="kw">let </span>now = Instant::now();
|
||||
<span class="macro">println!</span>(<span class="string">"[server] round {}"</span>, i + <span class="number">1</span>);
|
||||
<span class="kw">let </span>round_start = Instant::now();
|
||||
<span class="macro">info!</span>(<span class="string">"[server] round {i}"</span>);
|
||||
<span class="kw">let </span>incoming = ep.accept().<span class="kw">await</span>.unwrap();
|
||||
<span class="kw">let </span>conn = incoming.<span class="kw">await</span>.unwrap();
|
||||
<span class="kw">let </span>peer_id = get_remote_node_id(<span class="kw-2">&</span>conn).unwrap();
|
||||
@@ -3534,7 +3534,7 @@
|
||||
send.stopped().<span class="kw">await</span>.unwrap();
|
||||
recv.read_to_end(<span class="number">0</span>).<span class="kw">await</span>.unwrap();
|
||||
<span class="macro">info!</span>(%i, peer = %peer_id.fmt_short(), <span class="string">"finished"</span>);
|
||||
<span class="macro">println!</span>(<span class="string">"[server] round {} done in {:?}"</span>, i + <span class="number">1</span>, now.elapsed());
|
||||
<span class="macro">info!</span>(<span class="string">"[server] round {i} done in {:?}"</span>, round_start.elapsed());
|
||||
}
|
||||
}
|
||||
.instrument(<span class="macro">error_span!</span>(<span class="string">"server"</span>)),
|
||||
@@ -3546,8 +3546,8 @@
|
||||
});
|
||||
|
||||
<span class="kw">for </span>i <span class="kw">in </span><span class="number">0</span>..n_clients {
|
||||
<span class="kw">let </span>now = Instant::now();
|
||||
<span class="macro">println!</span>(<span class="string">"[client] round {}"</span>, i + <span class="number">1</span>);
|
||||
<span class="kw">let </span>round_start = Instant::now();
|
||||
<span class="macro">info!</span>(<span class="string">"[client] round {}"</span>, i);
|
||||
<span class="kw">let </span>relay_map = relay_map.clone();
|
||||
<span class="kw">let </span>client_secret_key = SecretKey::generate(<span class="kw-2">&mut </span>rng);
|
||||
<span class="kw">let </span>relay_url = relay_url.clone();
|
||||
@@ -3584,7 +3584,7 @@
|
||||
}
|
||||
.instrument(<span class="macro">error_span!</span>(<span class="string">"client"</span>, %i))
|
||||
.<span class="kw">await</span>;
|
||||
<span class="macro">println!</span>(<span class="string">"[client] round {} done in {:?}"</span>, i + <span class="number">1</span>, now.elapsed());
|
||||
<span class="macro">info!</span>(<span class="string">"[client] round {i} done in {:?}"</span>, round_start.elapsed());
|
||||
}
|
||||
|
||||
server.<span class="kw">await</span>.unwrap();
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -101,7 +101,7 @@
|
||||
<span class="self">Self</span>::default()
|
||||
}
|
||||
|
||||
<span class="doccomment">/// Clears the value
|
||||
<span class="doccomment">/// Sets the future to None again.
|
||||
</span><span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">fn </span>set_none(<span class="kw-2">mut </span><span class="self">self</span>: Pin<<span class="kw-2">&mut </span><span class="self">Self</span>>) {
|
||||
<span class="self">self</span>.as_mut().project_replace(<span class="self">Self</span>::None);
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -319,35 +319,97 @@
|
||||
<a href="#318" id="318">318</a>
|
||||
<a href="#319" id="319">319</a>
|
||||
<a href="#320" id="320">320</a>
|
||||
<a href="#321" id="321">321</a></pre></div><pre class="rust"><code><span class="doccomment">//! Manages client-side connections to the relay server.
|
||||
<a href="#321" id="321">321</a>
|
||||
<a href="#322" id="322">322</a>
|
||||
<a href="#323" id="323">323</a>
|
||||
<a href="#324" id="324">324</a>
|
||||
<a href="#325" id="325">325</a>
|
||||
<a href="#326" id="326">326</a>
|
||||
<a href="#327" id="327">327</a>
|
||||
<a href="#328" id="328">328</a>
|
||||
<a href="#329" id="329">329</a>
|
||||
<a href="#330" id="330">330</a>
|
||||
<a href="#331" id="331">331</a>
|
||||
<a href="#332" id="332">332</a>
|
||||
<a href="#333" id="333">333</a>
|
||||
<a href="#334" id="334">334</a>
|
||||
<a href="#335" id="335">335</a>
|
||||
<a href="#336" id="336">336</a>
|
||||
<a href="#337" id="337">337</a>
|
||||
<a href="#338" id="338">338</a>
|
||||
<a href="#339" id="339">339</a>
|
||||
<a href="#340" id="340">340</a>
|
||||
<a href="#341" id="341">341</a>
|
||||
<a href="#342" id="342">342</a>
|
||||
<a href="#343" id="343">343</a>
|
||||
<a href="#344" id="344">344</a>
|
||||
<a href="#345" id="345">345</a>
|
||||
<a href="#346" id="346">346</a>
|
||||
<a href="#347" id="347">347</a>
|
||||
<a href="#348" id="348">348</a>
|
||||
<a href="#349" id="349">349</a>
|
||||
<a href="#350" id="350">350</a>
|
||||
<a href="#351" id="351">351</a>
|
||||
<a href="#352" id="352">352</a>
|
||||
<a href="#353" id="353">353</a>
|
||||
<a href="#354" id="354">354</a>
|
||||
<a href="#355" id="355">355</a>
|
||||
<a href="#356" id="356">356</a>
|
||||
<a href="#357" id="357">357</a>
|
||||
<a href="#358" id="358">358</a>
|
||||
<a href="#359" id="359">359</a>
|
||||
<a href="#360" id="360">360</a>
|
||||
<a href="#361" id="361">361</a>
|
||||
<a href="#362" id="362">362</a>
|
||||
<a href="#363" id="363">363</a>
|
||||
<a href="#364" id="364">364</a></pre></div><pre class="rust"><code><span class="doccomment">//! Manages client-side connections to the relay server.
|
||||
//!
|
||||
//! based on tailscale/derp/derp_client.go
|
||||
|
||||
</span><span class="kw">use </span>std::{
|
||||
io,
|
||||
pin::Pin,
|
||||
task::{Context, Poll},
|
||||
time::Duration,
|
||||
};
|
||||
|
||||
<span class="kw">use </span>anyhow::{bail, ensure, <span class="prelude-ty">Result</span>};
|
||||
<span class="kw">use </span>anyhow::{bail, <span class="prelude-ty">Result</span>};
|
||||
<span class="kw">use </span>bytes::Bytes;
|
||||
<span class="kw">use </span>futures_lite::Stream;
|
||||
<span class="kw">use </span>futures_sink::Sink;
|
||||
<span class="kw">use </span>futures_util::SinkExt;
|
||||
<span class="kw">use </span>futures_util::Sink;
|
||||
<span class="kw">use </span>iroh_base::{NodeId, SecretKey};
|
||||
<span class="kw">use </span>tokio_tungstenite_wasm::WebSocketStream;
|
||||
<span class="kw">use </span>tokio_util::codec::Framed;
|
||||
<span class="kw">use </span>tracing::{debug, trace};
|
||||
<span class="kw">use </span>tracing::debug;
|
||||
|
||||
<span class="kw">use </span><span class="kw">super</span>::KeyCache;
|
||||
<span class="kw">use crate</span>::{
|
||||
client::streams::MaybeTlsStreamChained,
|
||||
protos::relay::{
|
||||
write_frame, ClientInfo, Frame, RelayCodec, MAX_PACKET_SIZE, PROTOCOL_VERSION,
|
||||
},
|
||||
protos::relay::{ClientInfo, Frame, RelayCodec, MAX_PACKET_SIZE, PROTOCOL_VERSION},
|
||||
};
|
||||
|
||||
<span class="doccomment">/// Error for sending messages to the relay server.
|
||||
</span><span class="attr">#[derive(Debug, thiserror::Error)]
|
||||
</span><span class="kw">pub enum </span>ConnSendError {
|
||||
<span class="doccomment">/// An IO error.
|
||||
</span><span class="attr">#[error(<span class="string">"IO error"</span>)]
|
||||
</span>Io(<span class="attr">#[from] </span>io::Error),
|
||||
<span class="doccomment">/// A protocol error.
|
||||
</span><span class="attr">#[error(<span class="string">"Protocol error"</span>)]
|
||||
</span>Protocol(<span class="kw-2">&</span><span class="lifetime">'static </span>str),
|
||||
}
|
||||
|
||||
<span class="doccomment">/// A connection to a relay server.
|
||||
///
|
||||
/// This holds a connection to a relay server. It is:
|
||||
///
|
||||
/// - A [`Stream`] for [`ReceivedMessage`] to receive from the server.
|
||||
/// - A [`Sink`] for [`SendMessage`] to send to the server.
|
||||
/// - A [`Sink`] for [`Frame`] to send to the server.
|
||||
///
|
||||
/// The [`Frame`] sink is a more internal interface, it allows performing the handshake.
|
||||
/// The [`SendMessage`] and [`ReceivedMessage`] are safer wrappers enforcing some protocol
|
||||
/// invariants.
|
||||
</span><span class="attr">#[derive(derive_more::Debug)]
|
||||
</span><span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">enum </span>Conn {
|
||||
Relay {
|
||||
@@ -391,50 +453,10 @@
|
||||
|
||||
<span class="prelude-val">Ok</span>(conn)
|
||||
}
|
||||
|
||||
<span class="doccomment">/// Sends a packet to the node identified by `dstkey`
|
||||
///
|
||||
/// Errors if the packet is larger than [`MAX_PACKET_SIZE`]
|
||||
</span><span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">async fn </span>send(<span class="kw-2">&mut </span><span class="self">self</span>, dst: NodeId, packet: Bytes) -> <span class="prelude-ty">Result</span><()> {
|
||||
<span class="macro">trace!</span>(dst = dst.fmt_short(), len = packet.len(), <span class="string">"[RELAY] send"</span>);
|
||||
send_packet(<span class="kw-2">&mut *</span><span class="self">self</span>, dst, packet).<span class="kw">await</span><span class="question-mark">?</span>;
|
||||
<span class="prelude-val">Ok</span>(())
|
||||
}
|
||||
|
||||
<span class="doccomment">/// Send a ping with 8 bytes of random data.
|
||||
</span><span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">async fn </span>send_ping(<span class="kw-2">&mut </span><span class="self">self</span>, data: [u8; <span class="number">8</span>]) -> <span class="prelude-ty">Result</span><()> {
|
||||
write_frame(<span class="kw-2">&mut *</span><span class="self">self</span>, Frame::Ping { data }, <span class="prelude-val">None</span>).<span class="kw">await</span><span class="question-mark">?</span>;
|
||||
<span class="self">self</span>.flush().<span class="kw">await</span><span class="question-mark">?</span>;
|
||||
<span class="prelude-val">Ok</span>(())
|
||||
}
|
||||
|
||||
<span class="doccomment">/// Respond to a ping request. The `data` field should be filled
|
||||
/// by the 8 bytes of random data send by the ping.
|
||||
</span><span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">async fn </span>send_pong(<span class="kw-2">&mut </span><span class="self">self</span>, data: [u8; <span class="number">8</span>]) -> <span class="prelude-ty">Result</span><()> {
|
||||
write_frame(<span class="kw-2">&mut *</span><span class="self">self</span>, Frame::Pong { data }, <span class="prelude-val">None</span>).<span class="kw">await</span><span class="question-mark">?</span>;
|
||||
<span class="self">self</span>.flush().<span class="kw">await</span><span class="question-mark">?</span>;
|
||||
<span class="prelude-val">Ok</span>(())
|
||||
}
|
||||
|
||||
<span class="doccomment">/// Sends a packet that tells the server whether this
|
||||
/// connection is to the user's preferred server. This is only
|
||||
/// used in the server for stats.
|
||||
</span><span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">async fn </span>note_preferred(<span class="kw-2">&mut </span><span class="self">self</span>, preferred: bool) -> <span class="prelude-ty">Result</span><()> {
|
||||
write_frame(<span class="kw-2">&mut *</span><span class="self">self</span>, Frame::NotePreferred { preferred }, <span class="prelude-val">None</span>).<span class="kw">await</span><span class="question-mark">?</span>;
|
||||
<span class="self">self</span>.flush().<span class="kw">await</span><span class="question-mark">?</span>;
|
||||
<span class="prelude-val">Ok</span>(())
|
||||
}
|
||||
|
||||
<span class="doccomment">/// Close the connection
|
||||
///
|
||||
/// Shuts down the write loop directly and marks the connection as closed. The [`Conn`] will
|
||||
/// check if the it is closed before attempting to read from it.
|
||||
</span><span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">async fn </span>close(<span class="kw-2">&mut </span><span class="self">self</span>) {
|
||||
SinkExt::close(<span class="self">self</span>).<span class="kw">await</span>.ok();
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">async fn </span>server_handshake(writer: <span class="kw-2">&mut </span>Conn, secret_key: <span class="kw-2">&</span>SecretKey) -> <span class="prelude-ty">Result</span><()> {
|
||||
<span class="doccomment">/// Sends the server handshake message.
|
||||
</span><span class="kw">async fn </span>server_handshake(writer: <span class="kw-2">&mut </span>Conn, secret_key: <span class="kw-2">&</span>SecretKey) -> <span class="prelude-ty">Result</span><()> {
|
||||
<span class="macro">debug!</span>(<span class="string">"server_handshake: started"</span>);
|
||||
<span class="kw">let </span>client_info = ClientInfo {
|
||||
version: PROTOCOL_VERSION,
|
||||
@@ -489,44 +511,105 @@
|
||||
}
|
||||
|
||||
<span class="kw">impl </span>Sink<Frame> <span class="kw">for </span>Conn {
|
||||
<span class="kw">type </span>Error = std::io::Error;
|
||||
<span class="kw">type </span>Error = ConnSendError;
|
||||
|
||||
<span class="kw">fn </span>poll_ready(<span class="kw-2">mut </span><span class="self">self</span>: Pin<<span class="kw-2">&mut </span><span class="self">Self</span>>, cx: <span class="kw-2">&mut </span>Context<<span class="lifetime">'_</span>>) -> Poll<<span class="prelude-ty">Result</span><(), <span class="self">Self</span>::Error>> {
|
||||
<span class="kw">match </span><span class="kw-2">*</span><span class="self">self </span>{
|
||||
<span class="self">Self</span>::Relay { <span class="kw-2">ref mut </span>conn } => Pin::new(conn).poll_ready(cx),
|
||||
<span class="self">Self</span>::Ws { <span class="kw-2">ref mut </span>conn, .. } => {
|
||||
Pin::new(conn).poll_ready(cx).map_err(tung_wasm_to_io_err)
|
||||
}
|
||||
<span class="self">Self</span>::Relay { <span class="kw-2">ref mut </span>conn } => Pin::new(conn).poll_ready(cx).map_err(Into::into),
|
||||
<span class="self">Self</span>::Ws { <span class="kw-2">ref mut </span>conn, .. } => Pin::new(conn)
|
||||
.poll_ready(cx)
|
||||
.map_err(tung_wasm_to_io_err)
|
||||
.map_err(Into::into),
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">fn </span>start_send(<span class="kw-2">mut </span><span class="self">self</span>: Pin<<span class="kw-2">&mut </span><span class="self">Self</span>>, item: Frame) -> <span class="prelude-ty">Result</span><(), <span class="self">Self</span>::Error> {
|
||||
<span class="kw">fn </span>start_send(<span class="kw-2">mut </span><span class="self">self</span>: Pin<<span class="kw-2">&mut </span><span class="self">Self</span>>, frame: Frame) -> <span class="prelude-ty">Result</span><(), <span class="self">Self</span>::Error> {
|
||||
<span class="kw">if let </span>Frame::SendPacket { dst_key: <span class="kw">_</span>, packet } = <span class="kw-2">&</span>frame {
|
||||
<span class="kw">if </span>packet.len() > MAX_PACKET_SIZE {
|
||||
<span class="kw">return </span><span class="prelude-val">Err</span>(ConnSendError::Protocol(<span class="string">"Packet exceeds MAX_PACKET_SIZE"</span>));
|
||||
}
|
||||
}
|
||||
<span class="kw">match </span><span class="kw-2">*</span><span class="self">self </span>{
|
||||
<span class="self">Self</span>::Relay { <span class="kw-2">ref mut </span>conn } => Pin::new(conn).start_send(item),
|
||||
<span class="self">Self</span>::Relay { <span class="kw-2">ref mut </span>conn } => Pin::new(conn).start_send(frame).map_err(Into::into),
|
||||
<span class="self">Self</span>::Ws { <span class="kw-2">ref mut </span>conn, .. } => Pin::new(conn)
|
||||
.start_send(tokio_tungstenite_wasm::Message::binary(
|
||||
item.encode_for_ws_msg(),
|
||||
frame.encode_for_ws_msg(),
|
||||
))
|
||||
.map_err(tung_wasm_to_io_err),
|
||||
.map_err(tung_wasm_to_io_err)
|
||||
.map_err(Into::into),
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">fn </span>poll_flush(<span class="kw-2">mut </span><span class="self">self</span>: Pin<<span class="kw-2">&mut </span><span class="self">Self</span>>, cx: <span class="kw-2">&mut </span>Context<<span class="lifetime">'_</span>>) -> Poll<<span class="prelude-ty">Result</span><(), <span class="self">Self</span>::Error>> {
|
||||
<span class="kw">match </span><span class="kw-2">*</span><span class="self">self </span>{
|
||||
<span class="self">Self</span>::Relay { <span class="kw-2">ref mut </span>conn } => Pin::new(conn).poll_flush(cx),
|
||||
<span class="self">Self</span>::Ws { <span class="kw-2">ref mut </span>conn, .. } => {
|
||||
Pin::new(conn).poll_flush(cx).map_err(tung_wasm_to_io_err)
|
||||
}
|
||||
<span class="self">Self</span>::Relay { <span class="kw-2">ref mut </span>conn } => Pin::new(conn).poll_flush(cx).map_err(Into::into),
|
||||
<span class="self">Self</span>::Ws { <span class="kw-2">ref mut </span>conn, .. } => Pin::new(conn)
|
||||
.poll_flush(cx)
|
||||
.map_err(tung_wasm_to_io_err)
|
||||
.map_err(Into::into),
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">fn </span>poll_close(<span class="kw-2">mut </span><span class="self">self</span>: Pin<<span class="kw-2">&mut </span><span class="self">Self</span>>, cx: <span class="kw-2">&mut </span>Context<<span class="lifetime">'_</span>>) -> Poll<<span class="prelude-ty">Result</span><(), <span class="self">Self</span>::Error>> {
|
||||
<span class="kw">match </span><span class="kw-2">*</span><span class="self">self </span>{
|
||||
<span class="self">Self</span>::Relay { <span class="kw-2">ref mut </span>conn } => Pin::new(conn).poll_close(cx),
|
||||
<span class="self">Self</span>::Ws { <span class="kw-2">ref mut </span>conn, .. } => {
|
||||
Pin::new(conn).poll_close(cx).map_err(tung_wasm_to_io_err)
|
||||
<span class="self">Self</span>::Relay { <span class="kw-2">ref mut </span>conn } => Pin::new(conn).poll_close(cx).map_err(Into::into),
|
||||
<span class="self">Self</span>::Ws { <span class="kw-2">ref mut </span>conn, .. } => Pin::new(conn)
|
||||
.poll_close(cx)
|
||||
.map_err(tung_wasm_to_io_err)
|
||||
.map_err(Into::into),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">impl </span>Sink<SendMessage> <span class="kw">for </span>Conn {
|
||||
<span class="kw">type </span>Error = ConnSendError;
|
||||
|
||||
<span class="kw">fn </span>poll_ready(<span class="kw-2">mut </span><span class="self">self</span>: Pin<<span class="kw-2">&mut </span><span class="self">Self</span>>, cx: <span class="kw-2">&mut </span>Context<<span class="lifetime">'_</span>>) -> Poll<<span class="prelude-ty">Result</span><(), <span class="self">Self</span>::Error>> {
|
||||
<span class="kw">match </span><span class="kw-2">*</span><span class="self">self </span>{
|
||||
<span class="self">Self</span>::Relay { <span class="kw-2">ref mut </span>conn } => Pin::new(conn).poll_ready(cx).map_err(Into::into),
|
||||
<span class="self">Self</span>::Ws { <span class="kw-2">ref mut </span>conn, .. } => Pin::new(conn)
|
||||
.poll_ready(cx)
|
||||
.map_err(tung_wasm_to_io_err)
|
||||
.map_err(Into::into),
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">fn </span>start_send(<span class="kw-2">mut </span><span class="self">self</span>: Pin<<span class="kw-2">&mut </span><span class="self">Self</span>>, item: SendMessage) -> <span class="prelude-ty">Result</span><(), <span class="self">Self</span>::Error> {
|
||||
<span class="kw">if let </span>SendMessage::SendPacket(<span class="kw">_</span>, bytes) = <span class="kw-2">&</span>item {
|
||||
<span class="kw">if </span>bytes.len() > MAX_PACKET_SIZE {
|
||||
<span class="kw">return </span><span class="prelude-val">Err</span>(ConnSendError::Protocol(<span class="string">"Packet exceeds MAX_PACKET_SIZE"</span>));
|
||||
}
|
||||
}
|
||||
<span class="kw">let </span>frame = Frame::from(item);
|
||||
<span class="kw">match </span><span class="kw-2">*</span><span class="self">self </span>{
|
||||
<span class="self">Self</span>::Relay { <span class="kw-2">ref mut </span>conn } => Pin::new(conn).start_send(frame).map_err(Into::into),
|
||||
<span class="self">Self</span>::Ws { <span class="kw-2">ref mut </span>conn, .. } => Pin::new(conn)
|
||||
.start_send(tokio_tungstenite_wasm::Message::binary(
|
||||
frame.encode_for_ws_msg(),
|
||||
))
|
||||
.map_err(tung_wasm_to_io_err)
|
||||
.map_err(Into::into),
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">fn </span>poll_flush(<span class="kw-2">mut </span><span class="self">self</span>: Pin<<span class="kw-2">&mut </span><span class="self">Self</span>>, cx: <span class="kw-2">&mut </span>Context<<span class="lifetime">'_</span>>) -> Poll<<span class="prelude-ty">Result</span><(), <span class="self">Self</span>::Error>> {
|
||||
<span class="kw">match </span><span class="kw-2">*</span><span class="self">self </span>{
|
||||
<span class="self">Self</span>::Relay { <span class="kw-2">ref mut </span>conn } => Pin::new(conn).poll_flush(cx).map_err(Into::into),
|
||||
<span class="self">Self</span>::Ws { <span class="kw-2">ref mut </span>conn, .. } => Pin::new(conn)
|
||||
.poll_flush(cx)
|
||||
.map_err(tung_wasm_to_io_err)
|
||||
.map_err(Into::into),
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">fn </span>poll_close(<span class="kw-2">mut </span><span class="self">self</span>: Pin<<span class="kw-2">&mut </span><span class="self">Self</span>>, cx: <span class="kw-2">&mut </span>Context<<span class="lifetime">'_</span>>) -> Poll<<span class="prelude-ty">Result</span><(), <span class="self">Self</span>::Error>> {
|
||||
<span class="kw">match </span><span class="kw-2">*</span><span class="self">self </span>{
|
||||
<span class="self">Self</span>::Relay { <span class="kw-2">ref mut </span>conn } => Pin::new(conn).poll_close(cx).map_err(Into::into),
|
||||
<span class="self">Self</span>::Ws { <span class="kw-2">ref mut </span>conn, .. } => Pin::new(conn)
|
||||
.poll_close(cx)
|
||||
.map_err(tung_wasm_to_io_err)
|
||||
.map_err(Into::into),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -620,24 +703,27 @@
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">async fn </span>send_packet<S: Sink<Frame, Error = std::io::Error> + Unpin>(
|
||||
<span class="kw-2">mut </span>writer: S,
|
||||
dst: NodeId,
|
||||
packet: Bytes,
|
||||
) -> <span class="prelude-ty">Result</span><()> {
|
||||
<span class="macro">ensure!</span>(
|
||||
packet.len() <= MAX_PACKET_SIZE,
|
||||
<span class="string">"packet too big: {}"</span>,
|
||||
packet.len()
|
||||
);
|
||||
<span class="doccomment">/// Messages we can send to a relay server.
|
||||
</span><span class="attr">#[derive(Debug)]
|
||||
</span><span class="kw">pub enum </span>SendMessage {
|
||||
<span class="doccomment">/// Send a packet of data to the [`NodeId`].
|
||||
</span>SendPacket(NodeId, Bytes),
|
||||
<span class="doccomment">/// Mark or unmark the connected relay as the home relay.
|
||||
</span>NotePreferred(bool),
|
||||
<span class="doccomment">/// Sends a ping message to the connected relay server.
|
||||
</span>Ping([u8; <span class="number">8</span>]),
|
||||
<span class="doccomment">/// Sends a pong message to the connected relay server.
|
||||
</span>Pong([u8; <span class="number">8</span>]),
|
||||
}
|
||||
|
||||
<span class="kw">let </span>frame = Frame::SendPacket {
|
||||
dst_key: dst,
|
||||
packet,
|
||||
};
|
||||
writer.send(frame).<span class="kw">await</span><span class="question-mark">?</span>;
|
||||
writer.flush().<span class="kw">await</span><span class="question-mark">?</span>;
|
||||
|
||||
<span class="prelude-val">Ok</span>(())
|
||||
<span class="kw">impl </span>From<SendMessage> <span class="kw">for </span>Frame {
|
||||
<span class="kw">fn </span>from(source: SendMessage) -> <span class="self">Self </span>{
|
||||
<span class="kw">match </span>source {
|
||||
SendMessage::SendPacket(dst_key, packet) => Frame::SendPacket { dst_key, packet },
|
||||
SendMessage::NotePreferred(preferred) => Frame::NotePreferred { preferred },
|
||||
SendMessage::Ping(data) => Frame::Ping { data },
|
||||
SendMessage::Pong(data) => Frame::Pong { data },
|
||||
}
|
||||
}
|
||||
}
|
||||
</code></pre></div></section></main></body></html>
|
||||
@@ -41,17 +41,7 @@
|
||||
<a href="#40" id="40">40</a>
|
||||
<a href="#41" id="41">41</a>
|
||||
<a href="#42" id="42">42</a>
|
||||
<a href="#43" id="43">43</a>
|
||||
<a href="#44" id="44">44</a>
|
||||
<a href="#45" id="45">45</a>
|
||||
<a href="#46" id="46">46</a>
|
||||
<a href="#47" id="47">47</a>
|
||||
<a href="#48" id="48">48</a>
|
||||
<a href="#49" id="49">49</a>
|
||||
<a href="#50" id="50">50</a>
|
||||
<a href="#51" id="51">51</a>
|
||||
<a href="#52" id="52">52</a>
|
||||
<a href="#53" id="53">53</a></pre></div><pre class="rust"><code><span class="doccomment">//! Default values used in the relay.
|
||||
<a href="#43" id="43">43</a></pre></div><pre class="rust"><code><span class="doccomment">//! Default values used in the relay.
|
||||
|
||||
/// The default STUN port used by the Relay server.
|
||||
///
|
||||
@@ -87,19 +77,9 @@
|
||||
<span class="doccomment">/// Timeout used by the relay client while connecting to the relay server,
|
||||
/// using `TcpStream::connect`
|
||||
</span><span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">const </span>DIAL_NODE_TIMEOUT: Duration = Duration::from_millis(<span class="number">1500</span>);
|
||||
<span class="doccomment">/// Timeout for expecting a pong from the relay server
|
||||
</span><span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">const </span>PING_TIMEOUT: Duration = Duration::from_secs(<span class="number">5</span>);
|
||||
<span class="doccomment">/// Timeout for the entire relay connection, which includes dns, dialing
|
||||
/// the server, upgrading the connection, and completing the handshake
|
||||
</span><span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">const </span>CONNECT_TIMEOUT: Duration = Duration::from_secs(<span class="number">10</span>);
|
||||
<span class="doccomment">/// Timeout for our async dns resolver
|
||||
</span><span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">const </span>DNS_TIMEOUT: Duration = Duration::from_secs(<span class="number">1</span>);
|
||||
|
||||
<span class="doccomment">/// Maximum time the client will wait to receive on the connection, since
|
||||
/// the last message. Longer than this time and the client will consider
|
||||
/// the connection dead.
|
||||
</span><span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">const </span>CLIENT_RECV_TIMEOUT: Duration = Duration::from_secs(<span class="number">120</span>);
|
||||
|
||||
<span class="doccomment">/// Maximum time the server will attempt to get a successful write to the connection.
|
||||
</span><span class="attr">#[cfg(feature = <span class="string">"server"</span>)]
|
||||
</span><span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">const </span>SERVER_WRITE_TIMEOUT: Duration = Duration::from_secs(<span class="number">2</span>);
|
||||
|
||||
@@ -839,7 +839,10 @@
|
||||
<a href="#838" id="838">838</a>
|
||||
<a href="#839" id="839">839</a>
|
||||
<a href="#840" id="840">840</a>
|
||||
<a href="#841" id="841">841</a></pre></div><pre class="rust"><code><span class="doccomment">//! This module implements the relaying protocol used by the `server` and `client`.
|
||||
<a href="#841" id="841">841</a>
|
||||
<a href="#842" id="842">842</a>
|
||||
<a href="#843" id="843">843</a>
|
||||
<a href="#844" id="844">844</a></pre></div><pre class="rust"><code><span class="doccomment">//! This module implements the relaying protocol used by the `server` and `client`.
|
||||
//!
|
||||
//! Protocol flow:
|
||||
//!
|
||||
@@ -853,6 +856,7 @@
|
||||
//! * clients sends `FrameType::SendPacket`
|
||||
//! * server then sends `FrameType::RecvPacket` to recipient
|
||||
|
||||
</span><span class="attr">#[cfg(feature = <span class="string">"server"</span>)]
|
||||
</span><span class="kw">use </span>std::time::Duration;
|
||||
|
||||
<span class="kw">use </span>anyhow::{bail, ensure};
|
||||
@@ -866,7 +870,7 @@
|
||||
<span class="kw">use </span>serde::{Deserialize, Serialize};
|
||||
<span class="kw">use </span>tokio_util::codec::{Decoder, Encoder};
|
||||
|
||||
<span class="kw">use </span><span class="kw">crate</span>::KeyCache;
|
||||
<span class="kw">use crate</span>::{client::conn::ConnSendError, KeyCache};
|
||||
|
||||
<span class="doccomment">/// The maximum size of a packet sent over relay.
|
||||
/// (This only includes the data bytes visible to magicsock, not
|
||||
@@ -971,6 +975,7 @@
|
||||
/// Ignores the timeout if `None`
|
||||
///
|
||||
/// Does not flush.
|
||||
</span><span class="attr">#[cfg(feature = <span class="string">"server"</span>)]
|
||||
</span><span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">async fn </span>write_frame<S: Sink<Frame, Error = std::io::Error> + Unpin>(
|
||||
<span class="kw-2">mut </span>writer: S,
|
||||
frame: Frame,
|
||||
@@ -989,7 +994,7 @@
|
||||
/// and the client's [`ClientInfo`], sealed using the server's [`PublicKey`].
|
||||
///
|
||||
/// Flushes after writing.
|
||||
</span><span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">async fn </span>send_client_key<S: Sink<Frame, Error = std::io::Error> + Unpin>(
|
||||
</span><span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">async fn </span>send_client_key<S: Sink<Frame, Error = ConnSendError> + Unpin>(
|
||||
<span class="kw-2">mut </span>writer: S,
|
||||
client_secret_key: <span class="kw-2">&</span>SecretKey,
|
||||
client_info: <span class="kw-2">&</span>ClientInfo,
|
||||
@@ -1455,7 +1460,8 @@
|
||||
</span><span class="kw">async fn </span>test_send_recv_client_key() -> anyhow::Result<()> {
|
||||
<span class="kw">let </span>(reader, writer) = tokio::io::duplex(<span class="number">1024</span>);
|
||||
<span class="kw">let </span><span class="kw-2">mut </span>reader = FramedRead::new(reader, RelayCodec::test());
|
||||
<span class="kw">let </span><span class="kw-2">mut </span>writer = FramedWrite::new(writer, RelayCodec::test());
|
||||
<span class="kw">let </span><span class="kw-2">mut </span>writer =
|
||||
FramedWrite::new(writer, RelayCodec::test()).sink_map_err(ConnSendError::from);
|
||||
|
||||
<span class="kw">let </span>client_key = SecretKey::generate(rand::thread_rng());
|
||||
<span class="kw">let </span>client_info = ClientInfo {
|
||||
|
||||
@@ -1108,13 +1108,7 @@
|
||||
<a href="#1107" id="1107">1107</a>
|
||||
<a href="#1108" id="1108">1108</a>
|
||||
<a href="#1109" id="1109">1109</a>
|
||||
<a href="#1110" id="1110">1110</a>
|
||||
<a href="#1111" id="1111">1111</a>
|
||||
<a href="#1112" id="1112">1112</a>
|
||||
<a href="#1113" id="1113">1113</a>
|
||||
<a href="#1114" id="1114">1114</a>
|
||||
<a href="#1115" id="1115">1115</a>
|
||||
<a href="#1116" id="1116">1116</a></pre></div><pre class="rust"><code><span class="doccomment">//! A fully-fledged iroh-relay server over HTTP or HTTPS.
|
||||
<a href="#1110" id="1110">1110</a></pre></div><pre class="rust"><code><span class="doccomment">//! A fully-fledged iroh-relay server over HTTP or HTTPS.
|
||||
//!
|
||||
//! This module provides an API to run a full fledged iroh-relay server. It is primarily
|
||||
//! used by the `iroh-relay` binary in this crate. It can be used to run a relay server in
|
||||
@@ -1890,12 +1884,13 @@
|
||||
<span class="kw">use </span>std::{net::Ipv4Addr, time::Duration};
|
||||
|
||||
<span class="kw">use </span>bytes::Bytes;
|
||||
<span class="kw">use </span>futures_util::SinkExt;
|
||||
<span class="kw">use </span>http::header::UPGRADE;
|
||||
<span class="kw">use </span>iroh_base::{NodeId, SecretKey};
|
||||
|
||||
<span class="kw">use super</span>::<span class="kw-2">*</span>;
|
||||
<span class="kw">use crate</span>::{
|
||||
client::{conn::ReceivedMessage, ClientBuilder},
|
||||
client::{conn::ReceivedMessage, ClientBuilder, SendMessage},
|
||||
http::{Protocol, HTTP_UPGRADE_PROTOCOL},
|
||||
};
|
||||
|
||||
@@ -1922,12 +1917,14 @@
|
||||
) -> <span class="prelude-ty">Result</span><ReceivedMessage> {
|
||||
<span class="comment">// try resend 10 times
|
||||
</span><span class="kw">for _ in </span><span class="number">0</span>..<span class="number">10 </span>{
|
||||
client_a.send(b_key, msg.clone()).<span class="kw">await</span><span class="question-mark">?</span>;
|
||||
<span class="kw">let </span><span class="prelude-val">Ok</span>(res) = tokio::time::timeout(Duration::from_millis(<span class="number">500</span>), client_b.recv()).<span class="kw">await
|
||||
client_a
|
||||
.send(SendMessage::SendPacket(b_key, msg.clone()))
|
||||
.<span class="kw">await</span><span class="question-mark">?</span>;
|
||||
<span class="kw">let </span><span class="prelude-val">Ok</span>(res) = tokio::time::timeout(Duration::from_millis(<span class="number">500</span>), client_b.next()).<span class="kw">await
|
||||
else </span>{
|
||||
<span class="kw">continue</span>;
|
||||
};
|
||||
<span class="kw">return </span>res<span class="question-mark">?</span>.unwrap();
|
||||
<span class="kw">return </span>res.context(<span class="string">"stream finished"</span>)<span class="question-mark">?</span>;
|
||||
}
|
||||
<span class="macro">panic!</span>(<span class="string">"failed to send and recv message"</span>);
|
||||
}
|
||||
@@ -2030,16 +2027,16 @@
|
||||
</span><span class="kw">let </span>a_secret_key = SecretKey::generate(rand::thread_rng());
|
||||
<span class="kw">let </span>a_key = a_secret_key.public();
|
||||
<span class="kw">let </span>resolver = <span class="kw">crate</span>::dns::default_resolver().clone();
|
||||
<span class="kw">let </span><span class="kw-2">mut </span>client_a =
|
||||
ClientBuilder::new(relay_url.clone()).build(a_secret_key, resolver.clone());
|
||||
client_a.connect().<span class="kw">await</span>.unwrap();
|
||||
<span class="kw">let </span><span class="kw-2">mut </span>client_a = ClientBuilder::new(relay_url.clone(), a_secret_key, resolver.clone())
|
||||
.connect()
|
||||
.<span class="kw">await</span><span class="question-mark">?</span>;
|
||||
|
||||
<span class="comment">// set up client b
|
||||
</span><span class="kw">let </span>b_secret_key = SecretKey::generate(rand::thread_rng());
|
||||
<span class="kw">let </span>b_key = b_secret_key.public();
|
||||
<span class="kw">let </span><span class="kw-2">mut </span>client_b =
|
||||
ClientBuilder::new(relay_url.clone()).build(b_secret_key, resolver.clone());
|
||||
client_b.connect().<span class="kw">await</span>.unwrap();
|
||||
<span class="kw">let </span><span class="kw-2">mut </span>client_b = ClientBuilder::new(relay_url.clone(), b_secret_key, resolver.clone())
|
||||
.connect()
|
||||
.<span class="kw">await</span><span class="question-mark">?</span>;
|
||||
|
||||
<span class="comment">// send message from a to b
|
||||
</span><span class="kw">let </span>msg = Bytes::from(<span class="string">"hello, b"</span>);
|
||||
@@ -2083,26 +2080,20 @@
|
||||
</span><span class="kw">let </span>a_secret_key = SecretKey::generate(rand::thread_rng());
|
||||
<span class="kw">let </span>a_key = a_secret_key.public();
|
||||
<span class="kw">let </span>resolver = <span class="kw">crate</span>::dns::default_resolver();
|
||||
<span class="macro">info!</span>(<span class="string">"client a build"</span>);
|
||||
<span class="kw">let </span><span class="kw-2">mut </span>client_a = ClientBuilder::new(relay_url.clone())
|
||||
<span class="macro">info!</span>(<span class="string">"client a build & connect"</span>);
|
||||
<span class="kw">let </span><span class="kw-2">mut </span>client_a = ClientBuilder::new(relay_url.clone(), a_secret_key, resolver.clone())
|
||||
.protocol(Protocol::Websocket)
|
||||
.build(a_secret_key, resolver.clone());
|
||||
|
||||
<span class="comment">// should already be connected after building the client
|
||||
</span><span class="macro">info!</span>(<span class="string">"client a connect"</span>);
|
||||
client_a.connect().<span class="kw">await</span><span class="question-mark">?</span>;
|
||||
.connect()
|
||||
.<span class="kw">await</span><span class="question-mark">?</span>;
|
||||
|
||||
<span class="comment">// set up client b
|
||||
</span><span class="kw">let </span>b_secret_key = SecretKey::generate(rand::thread_rng());
|
||||
<span class="kw">let </span>b_key = b_secret_key.public();
|
||||
<span class="macro">info!</span>(<span class="string">"client b build"</span>);
|
||||
<span class="kw">let </span><span class="kw-2">mut </span>client_b = ClientBuilder::new(relay_url.clone())
|
||||
<span class="macro">info!</span>(<span class="string">"client b build & connect"</span>);
|
||||
<span class="kw">let </span><span class="kw-2">mut </span>client_b = ClientBuilder::new(relay_url.clone(), b_secret_key, resolver.clone())
|
||||
.protocol(Protocol::Websocket) <span class="comment">// another websocket client
|
||||
</span>.build(b_secret_key, resolver.clone());
|
||||
|
||||
<span class="comment">// should already be connected after building the client
|
||||
</span><span class="macro">info!</span>(<span class="string">"client b connect"</span>);
|
||||
client_b.connect().<span class="kw">await</span><span class="question-mark">?</span>;
|
||||
</span>.connect()
|
||||
.<span class="kw">await</span><span class="question-mark">?</span>;
|
||||
|
||||
<span class="macro">info!</span>(<span class="string">"sending a -> b"</span>);
|
||||
|
||||
@@ -2151,21 +2142,18 @@
|
||||
</span><span class="kw">let </span>a_secret_key = SecretKey::generate(rand::thread_rng());
|
||||
<span class="kw">let </span>a_key = a_secret_key.public();
|
||||
<span class="kw">let </span>resolver = <span class="kw">crate</span>::dns::default_resolver().clone();
|
||||
<span class="kw">let </span><span class="kw-2">mut </span>client_a = ClientBuilder::new(relay_url.clone()).build(a_secret_key, resolver);
|
||||
|
||||
<span class="comment">// should already be connected after building the client
|
||||
</span>client_a.connect().<span class="kw">await</span>.unwrap();
|
||||
<span class="kw">let </span><span class="kw-2">mut </span>client_a = ClientBuilder::new(relay_url.clone(), a_secret_key, resolver)
|
||||
.connect()
|
||||
.<span class="kw">await</span><span class="question-mark">?</span>;
|
||||
|
||||
<span class="comment">// set up client b
|
||||
</span><span class="kw">let </span>b_secret_key = SecretKey::generate(rand::thread_rng());
|
||||
<span class="kw">let </span>b_key = b_secret_key.public();
|
||||
<span class="kw">let </span>resolver = <span class="kw">crate</span>::dns::default_resolver().clone();
|
||||
<span class="kw">let </span><span class="kw-2">mut </span>client_b = ClientBuilder::new(relay_url.clone())
|
||||
<span class="kw">let </span><span class="kw-2">mut </span>client_b = ClientBuilder::new(relay_url.clone(), b_secret_key, resolver)
|
||||
.protocol(Protocol::Websocket) <span class="comment">// Use websockets
|
||||
</span>.build(b_secret_key, resolver);
|
||||
|
||||
<span class="comment">// should already be connected after building the client
|
||||
</span>client_b.connect().<span class="kw">await</span>.unwrap();
|
||||
</span>.connect()
|
||||
.<span class="kw">await</span><span class="question-mark">?</span>;
|
||||
|
||||
<span class="comment">// send message from a to b
|
||||
</span><span class="kw">let </span>msg = Bytes::from(<span class="string">"hello, b"</span>);
|
||||
|
||||
@@ -348,7 +348,12 @@
|
||||
<a href="#347" id="347">347</a>
|
||||
<a href="#348" id="348">348</a>
|
||||
<a href="#349" id="349">349</a>
|
||||
<a href="#350" id="350">350</a></pre></div><pre class="rust"><code><span class="doccomment">//! The main event loop for the relay server.
|
||||
<a href="#350" id="350">350</a>
|
||||
<a href="#351" id="351">351</a>
|
||||
<a href="#352" id="352">352</a>
|
||||
<a href="#353" id="353">353</a>
|
||||
<a href="#354" id="354">354</a>
|
||||
<a href="#355" id="355">355</a></pre></div><pre class="rust"><code><span class="doccomment">//! The main event loop for the relay server.
|
||||
//!
|
||||
//! based on tailscale/derp/derp_server.go
|
||||
|
||||
@@ -599,6 +604,7 @@
|
||||
<span class="attr">#[cfg(test)]
|
||||
</span><span class="kw">mod </span>tests {
|
||||
<span class="kw">use </span>bytes::Bytes;
|
||||
<span class="kw">use </span>futures_util::SinkExt;
|
||||
<span class="kw">use </span>iroh_base::SecretKey;
|
||||
<span class="kw">use </span>tokio::io::DuplexStream;
|
||||
<span class="kw">use </span>tokio_util::codec::Framed;
|
||||
@@ -666,7 +672,11 @@
|
||||
|
||||
<span class="comment">// write message from b to a
|
||||
</span><span class="kw">let </span>msg = <span class="string">b"hello world!"</span>;
|
||||
<span class="kw">crate</span>::client::conn::send_packet(<span class="kw-2">&mut </span>b_io, node_id_a, Bytes::from_static(msg)).<span class="kw">await</span><span class="question-mark">?</span>;
|
||||
b_io.send(Frame::SendPacket {
|
||||
dst_key: node_id_a,
|
||||
packet: Bytes::from_static(msg),
|
||||
})
|
||||
.<span class="kw">await</span><span class="question-mark">?</span>;
|
||||
|
||||
<span class="comment">// get message on a's reader
|
||||
</span><span class="kw">let </span>frame = recv_frame(FrameType::RecvPacket, <span class="kw-2">&mut </span>a_io).<span class="kw">await</span><span class="question-mark">?</span>;
|
||||
|
||||
@@ -803,7 +803,21 @@
|
||||
<a href="#802" id="802">802</a>
|
||||
<a href="#803" id="803">803</a>
|
||||
<a href="#804" id="804">804</a>
|
||||
<a href="#805" id="805">805</a></pre></div><pre class="rust"><code><span class="doccomment">//! The server-side representation of an ongoing client relaying connection.
|
||||
<a href="#805" id="805">805</a>
|
||||
<a href="#806" id="806">806</a>
|
||||
<a href="#807" id="807">807</a>
|
||||
<a href="#808" id="808">808</a>
|
||||
<a href="#809" id="809">809</a>
|
||||
<a href="#810" id="810">810</a>
|
||||
<a href="#811" id="811">811</a>
|
||||
<a href="#812" id="812">812</a>
|
||||
<a href="#813" id="813">813</a>
|
||||
<a href="#814" id="814">814</a>
|
||||
<a href="#815" id="815">815</a>
|
||||
<a href="#816" id="816">816</a>
|
||||
<a href="#817" id="817">817</a>
|
||||
<a href="#818" id="818">818</a>
|
||||
<a href="#819" id="819">819</a></pre></div><pre class="rust"><code><span class="doccomment">//! The server-side representation of an ongoing client relaying connection.
|
||||
|
||||
</span><span class="kw">use </span>std::{future::Future, num::NonZeroU32, pin::Pin, sync::Arc, task::Poll, time::Duration};
|
||||
|
||||
@@ -1322,7 +1336,6 @@
|
||||
|
||||
<span class="kw">use super</span>::<span class="kw-2">*</span>;
|
||||
<span class="kw">use crate</span>::{
|
||||
client::conn,
|
||||
protos::relay::{recv_frame, FrameType, RelayCodec},
|
||||
server::streams::MaybeTlsStream,
|
||||
};
|
||||
@@ -1423,7 +1436,12 @@
|
||||
<span class="comment">// send packet
|
||||
</span><span class="macro">println!</span>(<span class="string">" send packet"</span>);
|
||||
<span class="kw">let </span>data = <span class="string">b"hello world!"</span>;
|
||||
conn::send_packet(<span class="kw-2">&mut </span>io_rw, target, Bytes::from_static(data)).<span class="kw">await</span><span class="question-mark">?</span>;
|
||||
io_rw
|
||||
.send(Frame::SendPacket {
|
||||
dst_key: target,
|
||||
packet: Bytes::from_static(data),
|
||||
})
|
||||
.<span class="kw">await</span><span class="question-mark">?</span>;
|
||||
<span class="kw">let </span>msg = server_channel_r.recv().<span class="kw">await</span>.unwrap();
|
||||
<span class="kw">match </span>msg {
|
||||
actor::Message::SendPacket {
|
||||
@@ -1446,7 +1464,12 @@
|
||||
</span><span class="kw">let </span><span class="kw-2">mut </span>disco_data = disco::MAGIC.as_bytes().to_vec();
|
||||
disco_data.extend_from_slice(target.as_bytes());
|
||||
disco_data.extend_from_slice(data);
|
||||
conn::send_packet(<span class="kw-2">&mut </span>io_rw, target, disco_data.clone().into()).<span class="kw">await</span><span class="question-mark">?</span>;
|
||||
io_rw
|
||||
.send(Frame::SendPacket {
|
||||
dst_key: target,
|
||||
packet: disco_data.clone().into(),
|
||||
})
|
||||
.<span class="kw">await</span><span class="question-mark">?</span>;
|
||||
<span class="kw">let </span>msg = server_channel_r.recv().<span class="kw">await</span>.unwrap();
|
||||
<span class="kw">match </span>msg {
|
||||
actor::Message::SendDiscoPacket {
|
||||
@@ -1505,7 +1528,12 @@
|
||||
<span class="kw">let </span>data = <span class="string">b"hello world!"</span>;
|
||||
<span class="kw">let </span>target = SecretKey::generate(rand::thread_rng()).public();
|
||||
|
||||
conn::send_packet(<span class="kw-2">&mut </span>io_rw, target, Bytes::from_static(data)).<span class="kw">await</span><span class="question-mark">?</span>;
|
||||
io_rw
|
||||
.send(Frame::SendPacket {
|
||||
dst_key: target,
|
||||
packet: Bytes::from_static(data),
|
||||
})
|
||||
.<span class="kw">await</span><span class="question-mark">?</span>;
|
||||
<span class="kw">let </span>msg = server_channel_r.recv().<span class="kw">await</span>.unwrap();
|
||||
<span class="kw">match </span>msg {
|
||||
actor::Message::SendPacket {
|
||||
|
||||
@@ -1135,7 +1135,13 @@
|
||||
<a href="#1134" id="1134">1134</a>
|
||||
<a href="#1135" id="1135">1135</a>
|
||||
<a href="#1136" id="1136">1136</a>
|
||||
<a href="#1137" id="1137">1137</a></pre></div><pre class="rust"><code><span class="kw">use </span>std::{
|
||||
<a href="#1137" id="1137">1137</a>
|
||||
<a href="#1138" id="1138">1138</a>
|
||||
<a href="#1139" id="1139">1139</a>
|
||||
<a href="#1140" id="1140">1140</a>
|
||||
<a href="#1141" id="1141">1141</a>
|
||||
<a href="#1142" id="1142">1142</a>
|
||||
<a href="#1143" id="1143">1143</a></pre></div><pre class="rust"><code><span class="kw">use </span>std::{
|
||||
collections::HashMap, future::Future, net::SocketAddr, pin::Pin, sync::Arc, time::Duration,
|
||||
};
|
||||
|
||||
@@ -1812,19 +1818,20 @@
|
||||
|
||||
<span class="attr">#[cfg(test)]
|
||||
</span><span class="kw">mod </span>tests {
|
||||
<span class="kw">use </span>std::{pin::pin, sync::Arc};
|
||||
<span class="kw">use </span>std::sync::Arc;
|
||||
|
||||
<span class="kw">use </span>anyhow::Result;
|
||||
<span class="kw">use </span>bytes::Bytes;
|
||||
<span class="kw">use </span>futures_lite::StreamExt;
|
||||
<span class="kw">use </span>futures_util::SinkExt;
|
||||
<span class="kw">use </span>iroh_base::{PublicKey, SecretKey};
|
||||
<span class="kw">use </span>reqwest::Url;
|
||||
<span class="kw">use </span>tracing::{info, info_span};
|
||||
<span class="kw">use </span>tracing::info;
|
||||
<span class="kw">use </span>tracing_subscriber::{prelude::<span class="kw-2">*</span>, EnvFilter};
|
||||
|
||||
<span class="kw">use super</span>::<span class="kw-2">*</span>;
|
||||
<span class="kw">use </span><span class="kw">crate</span>::client::{
|
||||
conn::{Conn, ReceivedMessage},
|
||||
conn::{Conn, ReceivedMessage, SendMessage},
|
||||
streams::MaybeTlsStreamChained,
|
||||
Client, ClientBuilder,
|
||||
};
|
||||
@@ -1880,80 +1887,67 @@
|
||||
<span class="kw">let </span>relay_addr: Url = <span class="macro">format!</span>(<span class="string">"http://{addr}:{port}"</span>).parse().unwrap();
|
||||
|
||||
<span class="comment">// create clients
|
||||
</span><span class="kw">let </span>(a_key, <span class="kw-2">mut </span>client_a) = {
|
||||
<span class="kw">let </span>span = <span class="macro">info_span!</span>(<span class="string">"client-a"</span>);
|
||||
<span class="kw">let </span>_guard = span.enter();
|
||||
create_test_client(a_key, relay_addr.clone())
|
||||
};
|
||||
</span><span class="kw">let </span>(a_key, <span class="kw-2">mut </span>client_a) = create_test_client(a_key, relay_addr.clone()).<span class="kw">await</span><span class="question-mark">?</span>;
|
||||
<span class="macro">info!</span>(<span class="string">"created client {a_key:?}"</span>);
|
||||
<span class="kw">let </span>(b_key, <span class="kw-2">mut </span>client_b) = {
|
||||
<span class="kw">let </span>span = <span class="macro">info_span!</span>(<span class="string">"client-b"</span>);
|
||||
<span class="kw">let </span>_guard = span.enter();
|
||||
create_test_client(b_key, relay_addr)
|
||||
};
|
||||
<span class="kw">let </span>(b_key, <span class="kw-2">mut </span>client_b) = create_test_client(b_key, relay_addr).<span class="kw">await</span><span class="question-mark">?</span>;
|
||||
<span class="macro">info!</span>(<span class="string">"created client {b_key:?}"</span>);
|
||||
|
||||
<span class="macro">info!</span>(<span class="string">"ping a"</span>);
|
||||
<span class="kw">let </span><span class="kw-2">mut </span>ping_a = <span class="macro">pin!</span>(client_a.send_ping().<span class="kw">await</span><span class="question-mark">?</span>);
|
||||
<span class="macro">tokio::select!</span> {
|
||||
<span class="kw">_ </span>= client_a.recv() => <span class="macro">panic!</span>(<span class="string">"unexpected msg"</span>),
|
||||
_dur = <span class="kw-2">&mut </span>ping_a => (),
|
||||
}
|
||||
client_a.send(SendMessage::Ping([<span class="number">1u8</span>; <span class="number">8</span>])).<span class="kw">await</span><span class="question-mark">?</span>;
|
||||
<span class="kw">let </span>pong = client_a.next().<span class="kw">await</span>.context(<span class="string">"eos"</span>)<span class="question-mark">??</span>;
|
||||
<span class="macro">assert!</span>(<span class="macro">matches!</span>(pong, ReceivedMessage::Pong(<span class="kw">_</span>)));
|
||||
|
||||
<span class="macro">info!</span>(<span class="string">"ping b"</span>);
|
||||
<span class="kw">let </span><span class="kw-2">mut </span>ping_b = <span class="macro">pin!</span>(client_b.send_ping().<span class="kw">await</span><span class="question-mark">?</span>);
|
||||
<span class="macro">tokio::select!</span> {
|
||||
<span class="kw">_ </span>= client_b.recv() => <span class="macro">panic!</span>(<span class="string">"unexpected msg"</span>),
|
||||
_dur = <span class="kw-2">&mut </span>ping_b => (),
|
||||
}
|
||||
client_b.send(SendMessage::Ping([<span class="number">2u8</span>; <span class="number">8</span>])).<span class="kw">await</span><span class="question-mark">?</span>;
|
||||
<span class="kw">let </span>pong = client_b.next().<span class="kw">await</span>.context(<span class="string">"eos"</span>)<span class="question-mark">??</span>;
|
||||
<span class="macro">assert!</span>(<span class="macro">matches!</span>(pong, ReceivedMessage::Pong(<span class="kw">_</span>)));
|
||||
|
||||
<span class="macro">info!</span>(<span class="string">"sending message from a to b"</span>);
|
||||
<span class="kw">let </span>msg = Bytes::from_static(<span class="string">b"hi there, client b!"</span>);
|
||||
client_a.send(b_key, msg.clone()).<span class="kw">await</span><span class="question-mark">?</span>;
|
||||
client_a
|
||||
.send(SendMessage::SendPacket(b_key, msg.clone()))
|
||||
.<span class="kw">await</span><span class="question-mark">?</span>;
|
||||
<span class="macro">info!</span>(<span class="string">"waiting for message from a on b"</span>);
|
||||
<span class="kw">let </span>(got_key, got_msg) =
|
||||
process_msg(client_b.recv().<span class="kw">await</span>).expect(<span class="string">"expected message from client_a"</span>);
|
||||
process_msg(client_b.next().<span class="kw">await</span>).expect(<span class="string">"expected message from client_a"</span>);
|
||||
<span class="macro">assert_eq!</span>(a_key, got_key);
|
||||
<span class="macro">assert_eq!</span>(msg, got_msg);
|
||||
|
||||
<span class="macro">info!</span>(<span class="string">"sending message from b to a"</span>);
|
||||
<span class="kw">let </span>msg = Bytes::from_static(<span class="string">b"right back at ya, client b!"</span>);
|
||||
client_b.send(a_key, msg.clone()).<span class="kw">await</span><span class="question-mark">?</span>;
|
||||
client_b
|
||||
.send(SendMessage::SendPacket(a_key, msg.clone()))
|
||||
.<span class="kw">await</span><span class="question-mark">?</span>;
|
||||
<span class="macro">info!</span>(<span class="string">"waiting for message b on a"</span>);
|
||||
<span class="kw">let </span>(got_key, got_msg) =
|
||||
process_msg(client_a.recv().<span class="kw">await</span>).expect(<span class="string">"expected message from client_b"</span>);
|
||||
process_msg(client_a.next().<span class="kw">await</span>).expect(<span class="string">"expected message from client_b"</span>);
|
||||
<span class="macro">assert_eq!</span>(b_key, got_key);
|
||||
<span class="macro">assert_eq!</span>(msg, got_msg);
|
||||
|
||||
client_a.close().<span class="kw">await</span>;
|
||||
client_b.close().<span class="kw">await</span>;
|
||||
client_a.close().<span class="kw">await</span><span class="question-mark">?</span>;
|
||||
client_b.close().<span class="kw">await</span><span class="question-mark">?</span>;
|
||||
server.shutdown();
|
||||
|
||||
<span class="prelude-val">Ok</span>(())
|
||||
}
|
||||
|
||||
<span class="kw">fn </span>create_test_client(key: SecretKey, server_url: Url) -> (PublicKey, Client) {
|
||||
<span class="kw">let </span>client = ClientBuilder::new(server_url).insecure_skip_cert_verify(<span class="bool-val">true</span>);
|
||||
<span class="kw">let </span>dns_resolver = <span class="kw">crate</span>::dns::default_resolver();
|
||||
<span class="kw">let </span>client = client.build(key.clone(), dns_resolver.clone());
|
||||
<span class="kw">async fn </span>create_test_client(key: SecretKey, server_url: Url) -> <span class="prelude-ty">Result</span><(PublicKey, Client)> {
|
||||
<span class="kw">let </span>public_key = key.public();
|
||||
<span class="kw">let </span>dns_resolver = <span class="kw">crate</span>::dns::default_resolver();
|
||||
<span class="kw">let </span>client = ClientBuilder::new(server_url, key, dns_resolver.clone())
|
||||
.insecure_skip_cert_verify(<span class="bool-val">true</span>);
|
||||
<span class="kw">let </span>client = client.connect().<span class="kw">await</span><span class="question-mark">?</span>;
|
||||
|
||||
(public_key, client)
|
||||
<span class="prelude-val">Ok</span>((public_key, client))
|
||||
}
|
||||
|
||||
<span class="kw">fn </span>process_msg(
|
||||
msg: std::result::Result<<span class="prelude-ty">Option</span><<span class="prelude-ty">Result</span><ReceivedMessage>>, tokio::time::error::Elapsed>,
|
||||
) -> <span class="prelude-ty">Option</span><(PublicKey, Bytes)> {
|
||||
<span class="kw">fn </span>process_msg(msg: <span class="prelude-ty">Option</span><<span class="prelude-ty">Result</span><ReceivedMessage>>) -> <span class="prelude-ty">Option</span><(PublicKey, Bytes)> {
|
||||
<span class="kw">match </span>msg {
|
||||
<span class="prelude-val">Ok</span>(<span class="prelude-val">None</span>) => {
|
||||
<span class="macro">info!</span>(<span class="string">"client received nothing"</span>);
|
||||
<span class="prelude-val">None
|
||||
</span>}
|
||||
<span class="prelude-val">Ok</span>(<span class="prelude-val">Some</span>(<span class="prelude-val">Err</span>(e))) => {
|
||||
<span class="prelude-val">Some</span>(<span class="prelude-val">Err</span>(e)) => {
|
||||
<span class="macro">info!</span>(<span class="string">"client `recv` error {e}"</span>);
|
||||
<span class="prelude-val">None
|
||||
</span>}
|
||||
<span class="prelude-val">Ok</span>(<span class="prelude-val">Some</span>(<span class="prelude-val">Ok</span>(msg))) => {
|
||||
<span class="prelude-val">Some</span>(<span class="prelude-val">Ok</span>(msg)) => {
|
||||
<span class="macro">info!</span>(<span class="string">"got message on: {msg:?}"</span>);
|
||||
<span class="kw">if let </span>ReceivedMessage::ReceivedPacket {
|
||||
remote_node_id: source,
|
||||
@@ -1965,8 +1959,8 @@
|
||||
<span class="prelude-val">None
|
||||
</span>}
|
||||
}
|
||||
<span class="prelude-val">Err</span>(<span class="kw">_</span>) => {
|
||||
<span class="macro">info!</span>(<span class="string">"client `recv` time out"</span>);
|
||||
<span class="prelude-val">None </span>=> {
|
||||
<span class="macro">info!</span>(<span class="string">"client end of stream"</span>);
|
||||
<span class="prelude-val">None
|
||||
</span>}
|
||||
}
|
||||
@@ -2004,47 +1998,47 @@
|
||||
<span class="kw">let </span>url: Url = <span class="macro">format!</span>(<span class="string">"https://localhost:{port}"</span>).parse().unwrap();
|
||||
|
||||
<span class="comment">// create clients
|
||||
</span><span class="kw">let </span>(a_key, <span class="kw-2">mut </span>client_a) = create_test_client(a_key, url.clone());
|
||||
</span><span class="kw">let </span>(a_key, <span class="kw-2">mut </span>client_a) = create_test_client(a_key, url.clone()).<span class="kw">await</span><span class="question-mark">?</span>;
|
||||
<span class="macro">info!</span>(<span class="string">"created client {a_key:?}"</span>);
|
||||
<span class="kw">let </span>(b_key, <span class="kw-2">mut </span>client_b) = create_test_client(b_key, url);
|
||||
<span class="kw">let </span>(b_key, <span class="kw-2">mut </span>client_b) = create_test_client(b_key, url).<span class="kw">await</span><span class="question-mark">?</span>;
|
||||
<span class="macro">info!</span>(<span class="string">"created client {b_key:?}"</span>);
|
||||
|
||||
<span class="macro">info!</span>(<span class="string">"ping a"</span>);
|
||||
<span class="kw">let </span><span class="kw-2">mut </span>ping_a = <span class="macro">pin!</span>(client_a.send_ping().<span class="kw">await</span><span class="question-mark">?</span>);
|
||||
<span class="macro">tokio::select!</span> {
|
||||
_msg = client_a.recv() => <span class="macro">panic!</span>(<span class="string">"unexpected msg"</span>),
|
||||
_dur = <span class="kw-2">&mut </span>ping_a => (),
|
||||
}
|
||||
client_a.send(SendMessage::Ping([<span class="number">1u8</span>; <span class="number">8</span>])).<span class="kw">await</span><span class="question-mark">?</span>;
|
||||
<span class="kw">let </span>pong = client_a.next().<span class="kw">await</span>.context(<span class="string">"eos"</span>)<span class="question-mark">??</span>;
|
||||
<span class="macro">assert!</span>(<span class="macro">matches!</span>(pong, ReceivedMessage::Pong(<span class="kw">_</span>)));
|
||||
|
||||
<span class="macro">info!</span>(<span class="string">"ping b"</span>);
|
||||
<span class="kw">let </span><span class="kw-2">mut </span>ping_b = <span class="macro">pin!</span>(client_b.send_ping().<span class="kw">await</span><span class="question-mark">?</span>);
|
||||
<span class="macro">tokio::select!</span> {
|
||||
_msg = client_b.recv() => <span class="macro">panic!</span>(<span class="string">"unexpected msg"</span>),
|
||||
_dur = <span class="kw-2">&mut </span>ping_b => (),
|
||||
}
|
||||
client_b.send(SendMessage::Ping([<span class="number">2u8</span>; <span class="number">8</span>])).<span class="kw">await</span><span class="question-mark">?</span>;
|
||||
<span class="kw">let </span>pong = client_b.next().<span class="kw">await</span>.context(<span class="string">"eos"</span>)<span class="question-mark">??</span>;
|
||||
<span class="macro">assert!</span>(<span class="macro">matches!</span>(pong, ReceivedMessage::Pong(<span class="kw">_</span>)));
|
||||
|
||||
<span class="macro">info!</span>(<span class="string">"sending message from a to b"</span>);
|
||||
<span class="kw">let </span>msg = Bytes::from_static(<span class="string">b"hi there, client b!"</span>);
|
||||
client_a.send(b_key, msg.clone()).<span class="kw">await</span><span class="question-mark">?</span>;
|
||||
client_a
|
||||
.send(SendMessage::SendPacket(b_key, msg.clone()))
|
||||
.<span class="kw">await</span><span class="question-mark">?</span>;
|
||||
<span class="macro">info!</span>(<span class="string">"waiting for message from a on b"</span>);
|
||||
<span class="kw">let </span>(got_key, got_msg) =
|
||||
process_msg(client_b.recv().<span class="kw">await</span>).expect(<span class="string">"expected message from client_a"</span>);
|
||||
process_msg(client_b.next().<span class="kw">await</span>).expect(<span class="string">"expected message from client_a"</span>);
|
||||
<span class="macro">assert_eq!</span>(a_key, got_key);
|
||||
<span class="macro">assert_eq!</span>(msg, got_msg);
|
||||
|
||||
<span class="macro">info!</span>(<span class="string">"sending message from b to a"</span>);
|
||||
<span class="kw">let </span>msg = Bytes::from_static(<span class="string">b"right back at ya, client b!"</span>);
|
||||
client_b.send(a_key, msg.clone()).<span class="kw">await</span><span class="question-mark">?</span>;
|
||||
client_b
|
||||
.send(SendMessage::SendPacket(a_key, msg.clone()))
|
||||
.<span class="kw">await</span><span class="question-mark">?</span>;
|
||||
<span class="macro">info!</span>(<span class="string">"waiting for message b on a"</span>);
|
||||
<span class="kw">let </span>(got_key, got_msg) =
|
||||
process_msg(client_a.recv().<span class="kw">await</span>).expect(<span class="string">"expected message from client_b"</span>);
|
||||
process_msg(client_a.next().<span class="kw">await</span>).expect(<span class="string">"expected message from client_b"</span>);
|
||||
<span class="macro">assert_eq!</span>(b_key, got_key);
|
||||
<span class="macro">assert_eq!</span>(msg, got_msg);
|
||||
|
||||
server.shutdown();
|
||||
server.task_handle().<span class="kw">await</span><span class="question-mark">?</span>;
|
||||
client_a.close().<span class="kw">await</span>;
|
||||
client_b.close().<span class="kw">await</span>;
|
||||
client_a.close().<span class="kw">await</span><span class="question-mark">?</span>;
|
||||
client_b.close().<span class="kw">await</span><span class="question-mark">?</span>;
|
||||
|
||||
<span class="prelude-val">Ok</span>(())
|
||||
}
|
||||
@@ -2096,7 +2090,9 @@
|
||||
|
||||
<span class="macro">info!</span>(<span class="string">"Send message from A to B."</span>);
|
||||
<span class="kw">let </span>msg = Bytes::from_static(<span class="string">b"hello client b!!"</span>);
|
||||
client_a.send(public_key_b, msg.clone()).<span class="kw">await</span><span class="question-mark">?</span>;
|
||||
client_a
|
||||
.send(SendMessage::SendPacket(public_key_b, msg.clone()))
|
||||
.<span class="kw">await</span><span class="question-mark">?</span>;
|
||||
<span class="kw">match </span>client_b.next().<span class="kw">await</span>.context(<span class="string">"eos"</span>)<span class="question-mark">?? </span>{
|
||||
ReceivedMessage::ReceivedPacket {
|
||||
remote_node_id,
|
||||
@@ -2112,7 +2108,9 @@
|
||||
|
||||
<span class="macro">info!</span>(<span class="string">"Send message from B to A."</span>);
|
||||
<span class="kw">let </span>msg = Bytes::from_static(<span class="string">b"nice to meet you client a!!"</span>);
|
||||
client_b.send(public_key_a, msg.clone()).<span class="kw">await</span><span class="question-mark">?</span>;
|
||||
client_b
|
||||
.send(SendMessage::SendPacket(public_key_a, msg.clone()))
|
||||
.<span class="kw">await</span><span class="question-mark">?</span>;
|
||||
<span class="kw">match </span>client_a.next().<span class="kw">await</span>.context(<span class="string">"eos"</span>)<span class="question-mark">?? </span>{
|
||||
ReceivedMessage::ReceivedPacket {
|
||||
remote_node_id,
|
||||
@@ -2132,7 +2130,10 @@
|
||||
|
||||
<span class="macro">info!</span>(<span class="string">"Fail to send message from A to B."</span>);
|
||||
<span class="kw">let </span>_res = client_a
|
||||
.send(public_key_b, Bytes::from_static(<span class="string">b"try to send"</span>))
|
||||
.send(SendMessage::SendPacket(
|
||||
public_key_b,
|
||||
Bytes::from_static(<span class="string">b"try to send"</span>),
|
||||
))
|
||||
.<span class="kw">await</span>;
|
||||
<span class="comment">// TODO: this send seems to succeed currently.
|
||||
// assert!(res.is_err());
|
||||
@@ -2185,7 +2186,9 @@
|
||||
|
||||
<span class="macro">info!</span>(<span class="string">"Send message from A to B."</span>);
|
||||
<span class="kw">let </span>msg = Bytes::from_static(<span class="string">b"hello client b!!"</span>);
|
||||
client_a.send(public_key_b, msg.clone()).<span class="kw">await</span><span class="question-mark">?</span>;
|
||||
client_a
|
||||
.send(SendMessage::SendPacket(public_key_b, msg.clone()))
|
||||
.<span class="kw">await</span><span class="question-mark">?</span>;
|
||||
<span class="kw">match </span>client_b.next().<span class="kw">await</span>.context(<span class="string">"eos"</span>)<span class="question-mark">?? </span>{
|
||||
ReceivedMessage::ReceivedPacket {
|
||||
remote_node_id,
|
||||
@@ -2201,7 +2204,9 @@
|
||||
|
||||
<span class="macro">info!</span>(<span class="string">"Send message from B to A."</span>);
|
||||
<span class="kw">let </span>msg = Bytes::from_static(<span class="string">b"nice to meet you client a!!"</span>);
|
||||
client_b.send(public_key_a, msg.clone()).<span class="kw">await</span><span class="question-mark">?</span>;
|
||||
client_b
|
||||
.send(SendMessage::SendPacket(public_key_a, msg.clone()))
|
||||
.<span class="kw">await</span><span class="question-mark">?</span>;
|
||||
<span class="kw">match </span>client_a.next().<span class="kw">await</span>.context(<span class="string">"eos"</span>)<span class="question-mark">?? </span>{
|
||||
ReceivedMessage::ReceivedPacket {
|
||||
remote_node_id,
|
||||
@@ -2229,7 +2234,9 @@
|
||||
|
||||
</span><span class="macro">info!</span>(<span class="string">"Send message from A to B."</span>);
|
||||
<span class="kw">let </span>msg = Bytes::from_static(<span class="string">b"are you still there, b?!"</span>);
|
||||
client_a.send(public_key_b, msg.clone()).<span class="kw">await</span><span class="question-mark">?</span>;
|
||||
client_a
|
||||
.send(SendMessage::SendPacket(public_key_b, msg.clone()))
|
||||
.<span class="kw">await</span><span class="question-mark">?</span>;
|
||||
<span class="kw">match </span>new_client_b.next().<span class="kw">await</span>.context(<span class="string">"eos"</span>)<span class="question-mark">?? </span>{
|
||||
ReceivedMessage::ReceivedPacket {
|
||||
remote_node_id,
|
||||
@@ -2245,7 +2252,9 @@
|
||||
|
||||
<span class="macro">info!</span>(<span class="string">"Send message from B to A."</span>);
|
||||
<span class="kw">let </span>msg = Bytes::from_static(<span class="string">b"just had a spot of trouble but I'm back now,a!!"</span>);
|
||||
new_client_b.send(public_key_a, msg.clone()).<span class="kw">await</span><span class="question-mark">?</span>;
|
||||
new_client_b
|
||||
.send(SendMessage::SendPacket(public_key_a, msg.clone()))
|
||||
.<span class="kw">await</span><span class="question-mark">?</span>;
|
||||
<span class="kw">match </span>client_a.next().<span class="kw">await</span>.context(<span class="string">"eos"</span>)<span class="question-mark">?? </span>{
|
||||
ReceivedMessage::ReceivedPacket {
|
||||
remote_node_id,
|
||||
@@ -2264,7 +2273,10 @@
|
||||
|
||||
<span class="macro">info!</span>(<span class="string">"Sending message from A to B fails"</span>);
|
||||
<span class="kw">let </span>_res = client_a
|
||||
.send(public_key_b, Bytes::from_static(<span class="string">b"try to send"</span>))
|
||||
.send(SendMessage::SendPacket(
|
||||
public_key_b,
|
||||
Bytes::from_static(<span class="string">b"try to send"</span>),
|
||||
))
|
||||
.<span class="kw">await</span>;
|
||||
<span class="comment">// TODO: This used to pass
|
||||
// assert!(res.is_err());
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,9 +1,9 @@
|
||||
(function() {
|
||||
var implementors = Object.fromEntries([["iroh",[["impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/error/trait.Error.html\" title=\"trait core::error::Error\">Error</a> for <a class=\"struct\" href=\"iroh/watchable/struct.Disconnected.html\" title=\"struct iroh::watchable::Disconnected\">Disconnected</a>"]]],["iroh_base",[["impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/error/trait.Error.html\" title=\"trait core::error::Error\">Error</a> for <a class=\"enum\" href=\"iroh_base/enum.KeyParsingError.html\" title=\"enum iroh_base::KeyParsingError\">KeyParsingError</a>"],["impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/error/trait.Error.html\" title=\"trait core::error::Error\">Error</a> for <a class=\"enum\" href=\"iroh_base/ticket/enum.Error.html\" title=\"enum iroh_base::ticket::Error\">Error</a>"],["impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/error/trait.Error.html\" title=\"trait core::error::Error\">Error</a> for <a class=\"struct\" href=\"iroh_base/struct.RelayUrlParseError.html\" title=\"struct iroh_base::RelayUrlParseError\">RelayUrlParseError</a>"]]],["iroh_relay",[["impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/error/trait.Error.html\" title=\"trait core::error::Error\">Error</a> for <a class=\"enum\" href=\"iroh_relay/client/enum.ClientError.html\" title=\"enum iroh_relay::client::ClientError\">ClientError</a>"],["impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/error/trait.Error.html\" title=\"trait core::error::Error\">Error</a> for <a class=\"enum\" href=\"iroh_relay/protos/stun/enum.Error.html\" title=\"enum iroh_relay::protos::stun::Error\">Error</a>"]]]]);
|
||||
var implementors = Object.fromEntries([["iroh",[["impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/error/trait.Error.html\" title=\"trait core::error::Error\">Error</a> for <a class=\"struct\" href=\"iroh/watchable/struct.Disconnected.html\" title=\"struct iroh::watchable::Disconnected\">Disconnected</a>"]]],["iroh_base",[["impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/error/trait.Error.html\" title=\"trait core::error::Error\">Error</a> for <a class=\"enum\" href=\"iroh_base/enum.KeyParsingError.html\" title=\"enum iroh_base::KeyParsingError\">KeyParsingError</a>"],["impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/error/trait.Error.html\" title=\"trait core::error::Error\">Error</a> for <a class=\"enum\" href=\"iroh_base/ticket/enum.Error.html\" title=\"enum iroh_base::ticket::Error\">Error</a>"],["impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/error/trait.Error.html\" title=\"trait core::error::Error\">Error</a> for <a class=\"struct\" href=\"iroh_base/struct.RelayUrlParseError.html\" title=\"struct iroh_base::RelayUrlParseError\">RelayUrlParseError</a>"]]],["iroh_relay",[["impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/error/trait.Error.html\" title=\"trait core::error::Error\">Error</a> for <a class=\"enum\" href=\"iroh_relay/client/enum.ConnSendError.html\" title=\"enum iroh_relay::client::ConnSendError\">ConnSendError</a>"],["impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/error/trait.Error.html\" title=\"trait core::error::Error\">Error</a> for <a class=\"enum\" href=\"iroh_relay/protos/stun/enum.Error.html\" title=\"enum iroh_relay::protos::stun::Error\">Error</a>"]]]]);
|
||||
if (window.register_implementors) {
|
||||
window.register_implementors(implementors);
|
||||
} else {
|
||||
window.pending_implementors = implementors;
|
||||
}
|
||||
})()
|
||||
//{"start":57,"fragment_lengths":[291,835,566]}
|
||||
//{"start":57,"fragment_lengths":[291,835,572]}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,9 +1,9 @@
|
||||
(function() {
|
||||
var implementors = Object.fromEntries([["iroh",[["impl<T: <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html\" title=\"trait core::clone::Clone\">Clone</a> + <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html\" title=\"trait core::cmp::Eq\">Eq</a>> Stream for <a class=\"struct\" href=\"iroh/watchable/struct.WatcherStream.html\" title=\"struct iroh::watchable::WatcherStream\">WatcherStream</a><T>"]]]]);
|
||||
var implementors = Object.fromEntries([["iroh",[["impl<T: <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html\" title=\"trait core::clone::Clone\">Clone</a> + <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html\" title=\"trait core::cmp::Eq\">Eq</a>> Stream for <a class=\"struct\" href=\"iroh/watchable/struct.WatcherStream.html\" title=\"struct iroh::watchable::WatcherStream\">WatcherStream</a><T>"]]],["iroh_relay",[["impl Stream for <a class=\"struct\" href=\"iroh_relay/client/struct.Client.html\" title=\"struct iroh_relay::client::Client\">Client</a>"],["impl Stream for <a class=\"struct\" href=\"iroh_relay/client/struct.ClientStream.html\" title=\"struct iroh_relay::client::ClientStream\">ClientStream</a>"]]]]);
|
||||
if (window.register_implementors) {
|
||||
window.register_implementors(implementors);
|
||||
} else {
|
||||
window.pending_implementors = implementors;
|
||||
}
|
||||
})()
|
||||
//{"start":57,"fragment_lengths":[444]}
|
||||
//{"start":57,"fragment_lengths":[444,317]}
|
||||
@@ -0,0 +1,9 @@
|
||||
(function() {
|
||||
var implementors = Object.fromEntries([["iroh_relay",[["impl Sink<<a class=\"enum\" href=\"iroh_relay/client/enum.SendMessage.html\" title=\"enum iroh_relay::client::SendMessage\">SendMessage</a>> for <a class=\"struct\" href=\"iroh_relay/client/struct.Client.html\" title=\"struct iroh_relay::client::Client\">Client</a>"],["impl Sink<<a class=\"enum\" href=\"iroh_relay/client/enum.SendMessage.html\" title=\"enum iroh_relay::client::SendMessage\">SendMessage</a>> for <a class=\"struct\" href=\"iroh_relay/client/struct.ClientSink.html\" title=\"struct iroh_relay::client::ClientSink\">ClientSink</a>"]]]]);
|
||||
if (window.register_implementors) {
|
||||
window.register_implementors(implementors);
|
||||
} else {
|
||||
window.pending_implementors = implementors;
|
||||
}
|
||||
})()
|
||||
//{"start":57,"fragment_lengths":[580]}
|
||||
Reference in New Issue
Block a user