always use iroh.testrun.org:4443 as relay

This commit is contained in:
Septias
2024-06-04 16:15:34 +02:00
committed by Hocuri
parent b5983035d5
commit e005226cc6

View File

@@ -235,25 +235,15 @@ impl Context {
let secret_key = SecretKey::generate(); let secret_key = SecretKey::generate();
let public_key = secret_key.public(); let public_key = secret_key.public();
let relay_mode = if let Some(relay_url) = self let relay_url = self
.metadata .metadata
.read() .read()
.await .await
.as_ref() .as_ref()
.and_then(|conf| conf.iroh_relay.clone()) .and_then(|conf| conf.iroh_relay.clone())
{ .unwrap_or(Url::parse("https://iroh.testrun.org:4443").unwrap());
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(),
))
};
let relay_mode = RelayMode::Custom(RelayMap::from_url(RelayUrl::from(relay_url)));
let endpoint = Endpoint::builder() let endpoint = Endpoint::builder()
.secret_key(secret_key) .secret_key(secret_key)
.alpns(vec![GOSSIP_ALPN.to_vec()]) .alpns(vec![GOSSIP_ALPN.to_vec()])