Skip to content

Commit

Permalink
Bind to all interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
oliver-ni committed Jul 14, 2024
1 parent 74ee4ec commit cec08db
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use tokio::{
use tokio_websockets::{Error, Limits, Message, ServerBuilder};
use tracing::{debug, error, info, trace, warn};

use std::{convert::Infallible, future::ready, net::SocketAddr, sync::Arc};
use std::{convert::Infallible, future::ready, net::SocketAddr, str::FromStr, sync::Arc};

use crate::{
config::CONFIG,
Expand Down Expand Up @@ -386,7 +386,8 @@ fn handler(
}

pub async fn run(port: u16, state: State, metrics_handle: PrometheusHandle) -> Result<(), Error> {
let addr: SocketAddr = ([0, 0, 0, 0], port).into();
let ip = IpAddr::from_str("::").unwrap();
let addr: SocketAddr = (ip, port).into();

let listener = match TcpListener::bind(addr).await {
Ok(listener) => listener,
Expand Down

0 comments on commit cec08db

Please sign in to comment.