Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions snippets/relay-endpoint-config.mdx
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
<CodeGroup>

```rust Rust
use iroh::Endpoint;
use iroh::relay::RelayUrl;
use iroh::{Endpoint, RelayMap, RelayMode, RelayUrl, endpoint::presets};

#[tokio::main]
async fn main() -> anyhow::Result<()> {
let relay_url1: RelayUrl = "YOUR_RELAY_URL_US".parse()?;
let relay_url2: RelayUrl = "YOUR_RELAY_URL_EU".parse()?;

let endpoint = Endpoint::builder()
.relay_mode(iroh::endpoint::RelayMode::Custom(vec![relay_url1, relay_url2]))
let endpoint = Endpoint::builder(presets::N0)
.relay_mode(RelayMode::Custom(RelayMap::from_iter([
relay_url1,
relay_url2,
])))
.bind()
.await?;

Expand Down
Loading