From c0cd511e4844ae68d0930645f7bf5de15f830385 Mon Sep 17 00:00:00 2001 From: JunichiSugiura Date: Tue, 20 Feb 2024 20:07:23 +0100 Subject: [PATCH] Replace 0.0.0.0 with localhost --- bin/torii/src/main.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bin/torii/src/main.rs b/bin/torii/src/main.rs index ec5f6f5e64..d2c1fe6485 100644 --- a/bin/torii/src/main.rs +++ b/bin/torii/src/main.rs @@ -197,10 +197,12 @@ async fn main() -> anyhow::Result<()> { .expect("Failed to start libp2p relay server"); let endpoint = format!("http://{}", args.addr); - let graphql = format!("{}/graphql", endpoint); - let encoded: String = form_urlencoded::byte_serialize(graphql.as_bytes()).collect(); + let gql_endpoint = format!("{}/graphql", endpoint); + let encoded: String = + form_urlencoded::byte_serialize(gql_endpoint.replace("0.0.0.0", "localhost").as_bytes()) + .collect(); info!(target: "torii::cli", "Starting torii endpoint: {}", endpoint); - info!(target: "torii::cli", "Serving Graphql playground: {}", graphql); + info!(target: "torii::cli", "Serving Graphql playground: {}", gql_endpoint); info!(target: "torii::cli", "World explorer is available on: {}\n", format!("https://worlds.dev/torii?url={}", encoded)); if let Some(listen_addr) = args.metrics {