} else {
format!("https://{}:{https_port}", acme_domains[0])
})
} else {
SpawnConfig::Http
};
let (http_result, https_result) = tokio::join!(
self.spawn(router.clone(), handle.clone(), http_port, http_spawn_config)?,
self.spawn(
router,
handle,
https_port,
SpawnConfig::Https(self.acceptor(&options)?),
)?
);
http_result.and(https_result)??;
}
(None, None) => unreachable!(),
}
Ok(Box::new(Empty {}) as Box<dyn Output>)
})
}
fn spawn(
&self,
router: Router,
handle: Handle,
port: u16,
config: SpawnConfig,
) -> Result<task::JoinHandle<io::Result<()>>> {
let addr = (self.address.as_str(), port)
.to_socket_addrs()?
.next()
.ok_or_else(|| anyhow!("failed to get socket addrs"))?;
if !integration_test() {
eprintln!(
"Listening on {}://{addr}",