Be more verbose during startup (fixes #12)

This commit is contained in:
Jonas Herzig 2020-07-05 12:26:15 +02:00
parent ec1a028aee
commit 0d499e4fb0

View file

@ -169,14 +169,19 @@ async fn main() -> Result<(), Error> {
} }
}; };
let upstream_host = Box::leak(Box::new(upstream_host.to_owned())).as_str(); let upstream_host = Box::leak(Box::new(upstream_host.to_owned())).as_str();
println!("Resolving upstream address {:?}", (upstream_host, upstream_port));
let upstream_addr = (upstream_host, upstream_port) let upstream_addr = (upstream_host, upstream_port)
.to_socket_addrs() .to_socket_addrs()
.expect("Failed to parse upstream address") .expect("Failed to parse upstream address")
.next() .next()
.expect("Failed to resolve upstream address"); .expect("Failed to resolve upstream address");
println!("Resolved upstream address: {}", upstream_addr);
println!("Binding to port {}", ws_port);
let socket_addr = (Ipv6Addr::from(0), ws_port); let socket_addr = (Ipv6Addr::from(0), ws_port);
let mut server = TcpListener::bind(&socket_addr).await?; let mut server = TcpListener::bind(&socket_addr).await?;
println!("Waiting for client connections..");
loop { loop {
let (client, _) = server.accept().await?; let (client, _) = server.accept().await?;
let addr = match client.peer_addr() { let addr = match client.peer_addr() {