diff --git a/src/api/mod.rs b/src/api/mod.rs index 317fccc..2d7630b 100644 --- a/src/api/mod.rs +++ b/src/api/mod.rs @@ -104,8 +104,9 @@ pub async fn start_api( log::info!(target: "symfonia::api", "Starting HTTP Server"); tokio::task::spawn(async move { + // .trim() needs to be called because \n is appended to the .to_string(), messing up the binding Server::new(TcpListener::bind( - SymfoniaConfiguration::get().api.to_string(), + SymfoniaConfiguration::get().api.to_string().trim(), )) .run(v9_api) .await diff --git a/src/gateway/mod.rs b/src/gateway/mod.rs index 52dbf6e..4e00e91 100644 --- a/src/gateway/mod.rs +++ b/src/gateway/mod.rs @@ -29,7 +29,7 @@ use futures::{ stream::{SplitSink, SplitStream}, SinkExt, StreamExt, }; -use log::info; +use log::{info, trace}; use pubserve::Subscriber; use serde_json::{from_str, json}; use sqlx::PgPool; @@ -104,7 +104,8 @@ pub async fn start_gateway( info!(target: "symfonia::gateway", "Starting gateway server"); let bind = &SymfoniaConfiguration::get().gateway.to_string(); - let try_socket = TcpListener::bind(&bind).await; + // .trim() needs to be called because \n is appended to the .to_string(), messing up the binding + let try_socket = TcpListener::bind(&bind.trim()).await; let listener = try_socket.expect("Failed to bind to address"); info!(target: "symfonia::gateway", "Gateway server listening on port {bind}");