diff options
author | Conrad Ludgate <conradludgate@gmail.com> | 2023-10-21 12:30:56 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-21 12:30:56 +0100 |
commit | d202afeaf5e81532217b6e6227990cf52b507604 (patch) | |
tree | 3f3dfd870167eeec8021fc77a429803b99e95230 /atuin-server | |
parent | 2f9df9350d5b645c867a440e63071d323fd53409 (diff) |
allow binding server to hostname (#1318)
Diffstat (limited to 'atuin-server')
-rw-r--r-- | atuin-server/src/lib.rs | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/atuin-server/src/lib.rs b/atuin-server/src/lib.rs index 007ad5c92..6778b099f 100644 --- a/atuin-server/src/lib.rs +++ b/atuin-server/src/lib.rs @@ -1,9 +1,6 @@ #![forbid(unsafe_code)] -use std::{ - future::Future, - net::{IpAddr, SocketAddr, TcpListener}, -}; +use std::{future::Future, net::TcpListener}; use atuin_server_database::Database; use axum::Server; @@ -43,13 +40,12 @@ async fn shutdown_signal() { pub async fn launch<Db: Database>( settings: Settings<Db::Settings>, - host: String, + host: &str, port: u16, ) -> Result<()> { - let host = host.parse::<IpAddr>()?; launch_with_listener::<Db>( settings, - TcpListener::bind(SocketAddr::new(host, port)).context("could not connect to socket")?, + TcpListener::bind((host, port)).context("could not connect to socket")?, shutdown_signal(), ) .await |