diff options
| author | Christine Dodrill <me@christine.website> | 2021-04-01 19:36:04 -0400 |
|---|---|---|
| committer | Christine Dodrill <me@christine.website> | 2021-04-01 19:36:04 -0400 |
| commit | adb0ebccf15548991b5b9a650aa1f62761222a47 (patch) | |
| tree | 8977f2d7a2ae9f2daaa9a3e660cb66210df1b1d3 /src/main.rs | |
| parent | 0360c87582e2e5025c06fec2431b867992dc71b0 (diff) | |
| download | xesite-ipv6.tar.xz xesite-ipv6.zip | |
enable ipv6 supportipv6
Signed-off-by: Christine Dodrill <me@christine.website>
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs index 7ebfbdf..054e18d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,6 +4,8 @@ extern crate tracing; use color_eyre::eyre::Result; use hyper::{header::CONTENT_TYPE, Body, Response}; use prometheus::{Encoder, TextEncoder}; +use std::net::IpAddr; +use std::str::FromStr; use std::sync::Arc; use warp::{path, Filter}; @@ -234,7 +236,8 @@ async fn main() -> Result<()> { warp::serve(site) .run(( - [0, 0, 0, 0], + IpAddr::from_str(&std::env::var("HOST").unwrap_or("::".into())) + .expect("can't parse bindhost"), std::env::var("PORT") .unwrap_or("3030".into()) .parse::<u16>() |
