fix: relay_server port configuration

This commit is contained in:
Henri Bourcereau 2026-07-28 13:21:39 +02:00
parent 9c13630c7d
commit a59d9f61e2
2 changed files with 7 additions and 2 deletions

View file

@ -35,7 +35,7 @@ use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt};
#[tokio::main]
/// Activates error tracing, spawns a watch dog task to eliminate eventual dead rooms, then it sets up the roting system to serve the
/// web sockets and listen for the pages enlist and reload. The server listens on port 8080.
/// web sockets and listen for the pages enlist and reload.
async fn main() {
tracing_subscriber::registry()
.with(
@ -104,7 +104,11 @@ async fn main() {
.layer(auth_layer)
.layer(cors);
let listener = tokio::net::TcpListener::bind("127.0.0.1:8080")
let port: u16 = std::env::var("RELAY_PORT")
.ok()
.and_then(|p| p.parse().ok())
.unwrap_or(8080);
let listener = tokio::net::TcpListener::bind(("127.0.0.1", port))
.await
.unwrap();