ipv6
This commit is contained in:
parent
c58eb32cc3
commit
ae90df49c1
1 changed files with 2 additions and 6 deletions
|
@ -84,16 +84,12 @@ async fn main() -> Result<()> {
|
|||
|
||||
let service = app.into_make_service();
|
||||
|
||||
let addr4 = SocketAddr::from((Ipv4Addr::UNSPECIFIED, opts.port));
|
||||
let addr6 = SocketAddr::from((Ipv6Addr::UNSPECIFIED, opts.port));
|
||||
println!("Listening on {} and {}...", addr4, addr6);
|
||||
println!("Listening on {}...", addr6);
|
||||
|
||||
let server4 = Server::bind(&addr4).serve(service.clone());
|
||||
let server6 = Server::bind(&addr6).serve(service);
|
||||
|
||||
let (result4, result6) = join!(server4, server6);
|
||||
result4?;
|
||||
result6?;
|
||||
server6.await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue