Switch default host to ipv6

This commit is contained in:
Nico Burns 2022-12-28 01:14:39 +00:00
parent 229f5d496a
commit 165e474114
2 changed files with 2 additions and 2 deletions

View file

@ -7,7 +7,7 @@ kill_timeout = 5
processes = [] processes = []
[env] [env]
HOST = "0.0.0.0" HOST = "::"
PORT = 3333 PORT = 3333
RUST_LOG = "debug" RUST_LOG = "debug"

View file

@ -31,7 +31,7 @@ async fn main() {
// run our app with hyper // run our app with hyper
// `axum::Server` is a re-export of `hyper::Server` // `axum::Server` is a re-export of `hyper::Server`
let host : IpAddr = std::env::var("HOST").ok().and_then(|h| h.parse().ok()).unwrap_or([127, 0, 0, 1].into()); let host : IpAddr = std::env::var("HOST").ok().and_then(|h| h.parse().ok()).unwrap_or("::".parse().unwrap());
let port = std::env::var("PORT").ok().and_then(|p| p.parse().ok()).unwrap_or(3333); let port = std::env::var("PORT").ok().and_then(|p| p.parse().ok()).unwrap_or(3333);
let addr = SocketAddr::from((host, port)); let addr = SocketAddr::from((host, port));
tracing::debug!("listening on {}", addr); tracing::debug!("listening on {}", addr);