bind to all interfaces

This commit is contained in:
Edward Shen 2021-10-03 19:18:31 -07:00
parent 9a10399d75
commit 282b12b62d
Signed by: edward
GPG key ID: 19182661E818369F

View file

@ -10,7 +10,7 @@ use std::net::{Ipv4Addr, Ipv6Addr, SocketAddr};
async fn main() {
let app = Router::new().route("/", get(root));
let addr = SocketAddr::from(([127, 0, 0, 1], 3000));
let addr = SocketAddr::from(([0, 0, 0, 0], 3000));
Server::bind(&addr)
.serve(app.into_make_service_with_connect_info::<SocketAddr, _>())
.await