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 Oct 21, 2024
1 parent ad5079e commit 5cb155d
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_tungstenite::{
};
use tracing::{debug, error, info, trace, warn};

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

use crate::{
cache::Event,
Expand Down Expand Up @@ -385,7 +385,8 @@ pub async fn run(
state: State,
metrics_handle: Arc<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 service = make_service_fn(move |addr: &AddrStream| {
let state = state.clone();
Expand Down

0 comments on commit 5cb155d

Please sign in to comment.