Skip to content

Commit

Permalink
always use iroh.testrun.org:4443 as relay
Browse files Browse the repository at this point in the history
  • Loading branch information
Septias committed Jun 4, 2024
1 parent a1051e9 commit 34a9ebe
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions src/peer_channels.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,25 +215,15 @@ impl Context {
async fn init_peer_channels(&self) -> Result<Iroh> {
let secret_key: SecretKey = SecretKey::generate();

let relay_mode = if let Some(relay_url) = self
let relay_url = self
.metadata
.read()
.await
.as_ref()
.and_then(|conf| conf.iroh_relay.clone())
{
RelayMode::Custom(RelayMap::from_url(RelayUrl::from(relay_url)))
} else {
#[cfg(test)]
{
RelayMode::Default
}
#[cfg(not(test))]
RelayMode::Custom(RelayMap::from_url(
Url::parse("ir.testrun.org").unwrap().into(),
))
};
.unwrap_or(Url::parse("https://iroh.testrun.org:4443").unwrap());

let relay_mode = RelayMode::Custom(RelayMap::from_url(RelayUrl::from(relay_url)));
let endpoint = Endpoint::builder()
.secret_key(secret_key.clone())
.alpns(vec![GOSSIP_ALPN.to_vec()])
Expand Down

0 comments on commit 34a9ebe

Please sign in to comment.